Skip to content

Commit

Permalink
fix log config
Browse files Browse the repository at this point in the history
  • Loading branch information
BeryJu committed Jan 5, 2025
1 parent cf84879 commit 026d510
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/extconfig/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@ func (e *ExtConfig) BuildLogger() *zap.Logger {
func (e *ExtConfig) BuildLoggerWithLevel(l zapcore.Level) *zap.Logger {
config := zap.Config{
Encoding: "json",
Development: false,
Development: e.Debug,
OutputPaths: []string{"stdout"},
ErrorOutputPaths: []string{"stderr"},
EncoderConfig: zap.NewProductionEncoderConfig(),
}
config.Level = zap.NewAtomicLevelAt(l)
config.DisableCaller = !e.Debug
if e.Debug {
config.Development = false
config.Encoding = "console"
config.EncoderConfig = zap.NewDevelopmentEncoderConfig()
config.EncoderConfig.EncodeLevel = zapcore.CapitalColorLevelEncoder
Expand Down

0 comments on commit 026d510

Please sign in to comment.