上传日志优化

This commit is contained in:
liwei1dao 2022-07-13 16:12:56 +08:00
parent c251a63adc
commit 710f28831e
5 changed files with 4 additions and 10 deletions

View File

@ -253,17 +253,11 @@ func (this *ModuleBase) Warnf(format string, a ...interface{}) {
} }
} }
func (this *ModuleBase) Errorf(format string, a ...interface{}) { func (this *ModuleBase) Errorf(format string, a ...interface{}) {
if this.options.GetDebug() { this.options.GetLog().Errorf(fmt.Sprintf("[Module:%s] ", this.module.GetType())+format, a...)
this.options.GetLog().Errorf(fmt.Sprintf("[Module:%s] ", this.module.GetType())+format, a...)
}
} }
func (this *ModuleBase) Panicf(format string, a ...interface{}) { func (this *ModuleBase) Panicf(format string, a ...interface{}) {
if this.options.GetDebug() { this.options.GetLog().Panicf(fmt.Sprintf("[Module:%s] ", this.module.GetType())+format, a...)
this.options.GetLog().Panicf(fmt.Sprintf("[Module:%s] ", this.module.GetType())+format, a...)
}
} }
func (this *ModuleBase) Fatalf(format string, a ...interface{}) { func (this *ModuleBase) Fatalf(format string, a ...interface{}) {
if this.options.GetDebug() { this.options.GetLog().Fatalf(fmt.Sprintf("[Module:%s] ", this.module.GetType())+format, a...)
this.options.GetLog().Fatalf(fmt.Sprintf("[Module:%s] ", this.module.GetType())+format, a...)
}
} }

View File

@ -158,7 +158,7 @@ func (this *SCompGateRoute) ReceiveMsg(ctx context.Context, args *pb.AgentMessag
} else { } else {
reply.Reply = session.Polls() reply.Reply = session.Polls()
if this.options.Debug { if this.options.Debug {
log.Debugf("[Handle Api] consumetime:%v method:%s uid:%s msg:%v reply:%v", time.Since(stime), method, args.UserId, msg, reply) log.Debugf("[Handle Api] consumetime:%v method:%s uid:%s msg:%v reply:%#v", time.Since(stime), method, args.UserId, msg, reply)
} }
} }
} else { //未找到消息处理函数 } else { //未找到消息处理函数