Skip to content

Commit

Permalink
Change to use bool to define debug option.
Browse files Browse the repository at this point in the history
  • Loading branch information
KaKa Lee committed Feb 27, 2017
1 parent adad632 commit e809899
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion lg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import (
)

func TestLg(t *testing.T) {
InitLogger("debug")
InitLogger(true)
L(nil).Info("test message.")
}

0 comments on commit e809899

Please sign in to comment.