作者 yangfu

1.日志记录修改

... ... @@ -51,6 +51,8 @@ func (hook SqlGeneratePrintHook) BeforeQuery(c context.Context, q *pg.QueryEvent
func (hook SqlGeneratePrintHook) AfterQuery(c context.Context, q *pg.QueryEvent) error {
data, err := q.FormattedQuery()
//fmt.Println(string(data))
log.Debug(string(data))
if len(string(data)) > 6 { //BEGIN COMMIT
log.Debug(string(data))
}
return err
}
... ...
... ... @@ -38,7 +38,7 @@ func NewBeegoLogger(conf LoggerConfig) *logs.BeeLogger {
}
log.SetLevel(ilv)
log.EnableFuncCallDepth(true)
log.SetLogFuncCallDepth(3)
log.SetLogFuncCallDepth(5)
return log
}
... ...
... ... @@ -100,7 +100,7 @@ func NewReturnResponse(data interface{}, eRR error) *ResponseMessage {
msg.Data = data
return msg
}
fmt.Println("日志:" + eRR.Error())
//log.Error("服务错误:" + eRR.Error())
if x, ok := eRR.(CustomErrParse); ok {
msg = x.ParseToMessage()
msg.Data = data
... ...