Skip to content

Commit

Permalink
Update logger.go
Browse files Browse the repository at this point in the history
  • Loading branch information
lyschoening authored Mar 23, 2021
1 parent 8c48ebc commit 90924bb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ func init() {
panic(err)
}

err := zap.RegisterEncoder("stackdriver-json", newEncoder)
if err != nil {
panic(err)
}

var config zap.Config
if cfg.Debug {
config = zapdriver.NewDevelopmentConfig()
config.Encoding = "console"
} else {
config = zapdriver.NewProductionConfig()
config.Encoding = "stackdriver-json"
Expand Down

0 comments on commit 90924bb

Please sign in to comment.