ws update

This commit is contained in:
Gordon
2023-03-23 15:56:47 +08:00
parent a5380a971b
commit 393dfa5902
4 changed files with 24 additions and 5 deletions
+8
View File
@@ -148,6 +148,8 @@ func (l *ZapLogger) kvAppend(ctx context.Context, keysAndValues []interface{}) [
opUserID := mcontext.GetOpUserID(ctx)
connID := mcontext.GetConnID(ctx)
triggerID := mcontext.GetTriggerID(ctx)
opUserPlatform := mcontext.GetOpUserPlatform(ctx)
remoteAddr := mcontext.GetRemoteAddr(ctx)
if opUserID != "" {
keysAndValues = append([]interface{}{constant.OpUserID, opUserID}, keysAndValues...)
}
@@ -160,6 +162,12 @@ func (l *ZapLogger) kvAppend(ctx context.Context, keysAndValues []interface{}) [
if triggerID != "" {
keysAndValues = append([]interface{}{constant.TriggerID, triggerID}, keysAndValues...)
}
if opUserPlatform != "" {
keysAndValues = append([]interface{}{constant.OpUserPlatform, opUserPlatform}, keysAndValues...)
}
if remoteAddr != "" {
keysAndValues = append([]interface{}{constant.RemoteAddr, remoteAddr}, keysAndValues...)
}
return keysAndValues
}