master
Evan Chen 2021-12-22 02:17:30 +08:00
parent 3e574be3c4
commit d06ee14e9d
2 changed files with 7 additions and 5 deletions

View File

@ -8,7 +8,7 @@ import (
"gorm.io/gorm"
)
//User User model
// User User model
type User struct {
ID string `gorm:"primaryKey"`

View File

@ -32,10 +32,9 @@ func (srv *Service) Default(c *gin.Context) {
c.Abort()
cl.Str("error", fmt.Sprint(err))
}
if !util.PROD {
cl.Caller(2)
// cl.Str("trace", util.Stack())
}
// if !util.PROD {
// cl.Str("trace", util.Stack())
// }
} else if c.Writer.Status() >= 400 {
cl = srv.l.Error().Strs("error", c.Errors.Errors())
} else {
@ -47,6 +46,9 @@ func (srv *Service) Default(c *gin.Context) {
if usr, ok := c.Get("user"); ok {
cl.Str("user", usr.(string))
}
if !util.PROD {
cl.Caller(2)
}
cl.
Str("method", c.Request.Method).
Str("ip", c.ClientIP()).