From 55f5d7ecd9714521a90c6592d2ce40d55944a475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E7=99=BD=E5=8D=97?= <1762386214@qq.com> Date: Fri, 8 Oct 2021 21:04:54 +0800 Subject: [PATCH] fix(log) fix produce msg, remove more route --- pkg/logx/logx.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/logx/logx.go b/pkg/logx/logx.go index 8ae7ebd..1f70005 100644 --- a/pkg/logx/logx.go +++ b/pkg/logx/logx.go @@ -40,7 +40,12 @@ func (l *upLogger) Print(level string, format string, msg ...interface{}) { Print(level, format, msg...) eventMiddle := event.NewEvent(middleMsg.EventNameLog) - eventMiddle.SetValue(middleMsg.EventKeyLog, middleMsg.LogContext{}) + eventMiddle.SetValue(middleMsg.EventKeyLog, middleMsg.LogContext{ + Level: level, + Data: time.Now(), + Msg: fmt.Sprintf(format, msg...), + Route: findPlace(), + }) l.produce.Call(l.ctx, eventMiddle) } @@ -80,7 +85,7 @@ func findPlace() string { var ( place string - i = 0 + i = 3 ) for {