From 90924bbe2643017848bf5c7184c24660c8dff6ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Sch=C3=B6ning?= Date: Tue, 23 Mar 2021 14:03:12 +0100 Subject: [PATCH] Update logger.go --- logger.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/logger.go b/logger.go index aefe889..332c1c7 100644 --- a/logger.go +++ b/logger.go @@ -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"