move commandName to metadata in logging
This commit is contained in:
1 parent
7d4a5c4c6c
commit
db03a888fb
2 files changed
+8
-6
No files matched your search
+4
-3
@@ -36,9 +36,10 @@ func (h *socketEventHandler) handleModuleReady(conn ws.Conn, data []byte) string
|
||||
}
|
||||
if applyLogResponse.ApplyError != "" {
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"comment": applyLogResponse.Comment,
|
||||
"applyError": applyLogResponse.ApplyError,
|
||||
}).Warn(codes.SyncApplyError, "apply UpdateBackendDeclarationCommand")
|
||||
"comment": applyLogResponse.Comment,
|
||||
"applyError": applyLogResponse.ApplyError,
|
||||
"commandName": "UpdateBackendDeclarationCommand",
|
||||
}).Warn(codes.SyncApplyError, "apply command")
|
||||
return applyLogResponse.ApplyError
|
||||
}
|
||||
}
|
||||
|
||||
+4
-3
@@ -20,8 +20,9 @@ func (h *socketEventHandler) SyncApplyCommand(command []byte, commandName string
|
||||
}
|
||||
if applyLogResponse != nil && applyLogResponse.ApplyError != "" {
|
||||
log.WithMetadata(map[string]interface{}{
|
||||
"comment": applyLogResponse.Comment,
|
||||
"applyError": applyLogResponse.ApplyError,
|
||||
}).Warnf(codes.SyncApplyError, "apply %s", commandName)
|
||||
"comment": applyLogResponse.Comment,
|
||||
"applyError": applyLogResponse.ApplyError,
|
||||
"commandName": commandName,
|
||||
}).Warnf(codes.SyncApplyError, "apply command")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user