Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
fix color for json format
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Koryabkin committed Feb 21, 2020
1 parent 450e920 commit af384cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit af384cd

Please sign in to comment.