From 255ea00084485f8c857c611ff4fd5c1e020e0ce4 Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Mon, 20 Dec 2021 02:46:00 +0800 Subject: [PATCH] update --- server/middleware.go | 4 ++-- system/setup.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/middleware.go b/server/middleware.go index b4d7c9f..db89fe5 100644 --- a/server/middleware.go +++ b/server/middleware.go @@ -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()) diff --git a/system/setup.go b/system/setup.go index cf3f53f..28a0186 100644 --- a/system/setup.go +++ b/system/setup.go @@ -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") {