作者 yangfu

1.日志记录修改

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