diff --git a/lg.go b/lg.go index 67ffc31..d0cf358 100644 --- a/lg.go +++ b/lg.go @@ -26,10 +26,10 @@ func Rfc3339NanoEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder) { } // InitLogger must be first to be called. -func InitLogger(debug string) { +func InitLogger(debug bool) { var cfg zap.Config - if debug == "debug" { + if debug { cfg = zap.NewDevelopmentConfig() } else { cfg = zap.NewProductionConfig() diff --git a/lg_test.go b/lg_test.go index 55fb229..468c19d 100644 --- a/lg_test.go +++ b/lg_test.go @@ -5,6 +5,6 @@ import ( ) func TestLg(t *testing.T) { - InitLogger("debug") + InitLogger(true) L(nil).Info("test message.") }