From af384cd3ffda279336bf7cd992d35bd4639a5185 Mon Sep 17 00:00:00 2001 From: Nikita Koryabkin Date: Fri, 21 Feb 2020 11:28:20 +0300 Subject: [PATCH] fix color for json format --- config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.go b/config.go index c8c0988..8d9bde0 100644 --- a/config.go +++ b/config.go @@ -54,7 +54,7 @@ func (c *config) withSetting(setting *Setting) *config { if setting.Out != nil { c.writer = zapcore.AddSync(setting.Out) } - if setting.Color { + if setting.Color && c.format == Console { c.encCfg.EncodeLevel = zapcore.CapitalColorLevelEncoder } return c