Skip to content

Commit

Permalink
add Fatlaf to default log
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Jan 12, 2019
1 parent fbe1c7c commit 07dcefe
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion interface.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package lgr

import stdlog "log"
import (
stdlog "log"
"os"
)

var def = New() // default logger doesn't allow DEBUG and doesn't add caller info

Expand Down Expand Up @@ -31,6 +34,12 @@ func Print(line string) {
def.Logf(line)
}

// Fatalf simplifies replacement of std logger
func Fatalf(format string, args ...interface{}) {
def.Logf(format, args...)
os.Exit(1)
}

// Setup default logger with options
func Setup(opts ...Option) {
def = New(opts...)
Expand Down

0 comments on commit 07dcefe

Please sign in to comment.