diff --git a/modules/chat/options.go b/modules/chat/options.go index a25c94c81..5b5a721a4 100644 --- a/modules/chat/options.go +++ b/modules/chat/options.go @@ -34,8 +34,7 @@ func (this *Options) LoadConfig(settings map[string]interface{}) (err error) { return } } - - if this.Log = log.NewTurnlog(this.Debug, log.Clone("", 4)); this.Log == nil { + if this.Log = log.NewTurnlog(true, log.Clone("", 4)); this.Log == nil { err = errors.New("log is nil") } return diff --git a/services/comp_gateroute.go b/services/comp_gateroute.go index 5e1a135c0..d6284d7fa 100644 --- a/services/comp_gateroute.go +++ b/services/comp_gateroute.go @@ -30,11 +30,9 @@ type msghandle struct { //组件参数 type CompOptions struct { - Debug bool } func (this *CompOptions) LoadConfig(settings map[string]interface{}) (err error) { - this.Debug = true if settings != nil { err = mapstructure.Decode(settings, this) } @@ -166,16 +164,14 @@ func (this *SCompGateRoute) ReceiveMsg(ctx context.Context, args *pb.AgentMessag ) } else { reply.Reply = session.Polls() - if this.options.Debug { - // log.Debugf("[Handle Api] t:%v m:%s uid:%s req:%v reply:%v", time.Since(stime), method, args.UserId, msg, reply) - log.Debug("[Handle Api]", - log.Field{Key: "t", Value: time.Since(stime).Milliseconds()}, - log.Field{Key: "m", Value: method}, - log.Field{Key: "uid", Value: args.UserId}, - log.Field{Key: "req", Value: msg}, - log.Field{Key: "reply", Value: reply.String()}, - ) - } + // log.Debugf("[Handle Api] t:%v m:%s uid:%s req:%v reply:%v", time.Since(stime), method, args.UserId, msg, reply) + log.Debug("[Handle Api]", + log.Field{Key: "t", Value: time.Since(stime).Milliseconds()}, + log.Field{Key: "m", Value: method}, + log.Field{Key: "uid", Value: args.UserId}, + log.Field{Key: "req", Value: msg}, + log.Field{Key: "reply", Value: reply.String()}, + ) } } else { //未找到消息处理函数 log.Errorf("[Handle Api] no found handle %s", method) diff --git a/sys/db/db.go b/sys/db/db.go index 974467a74..747365266 100644 --- a/sys/db/db.go +++ b/sys/db/db.go @@ -13,6 +13,7 @@ import ( func newSys(options *Options) (sys *DB, err error) { sys = &DB{ options: options, + servers: make(map[string]*DBConn), data: make(map[string]*ModelDataExpired), } if err = sys.init(); err != nil {