master
Evan Chen 2021-12-20 02:46:00 +08:00
parent 620745c32c
commit 255ea00084
2 changed files with 3 additions and 3 deletions

View File

@ -33,8 +33,8 @@ func (srv *Service) Default(c *gin.Context) {
cl.Str("error", fmt.Sprint(err))
}
if !util.PROD {
cl.Caller(3)
cl.Str("trace", util.Stack())
cl.Caller(2)
// cl.Str("trace", util.Stack())
}
} else if c.Writer.Status() >= 400 {
cl = srv.l.Error().Strs("error", c.Errors.Errors())

View File

@ -51,7 +51,7 @@ func Setup() {
zerolog.DurationFieldInteger = true
zerolog.SetGlobalLevel(zerolog.Level(viper.GetInt("log.level")))
util.PROD = viper.GetBool("prod")
if util.PROD {
if !util.PROD {
log.Logger = log.With().Caller().Logger()
}
if viper.GetBool("log.pretty") {