From e929f89ceeedc48a45611382be9882db0bf1921d Mon Sep 17 00:00:00 2001 From: Mark Theunissen Date: Tue, 8 Apr 2025 17:39:49 +0200 Subject: [PATCH] =?UTF-8?q?ConsoleMsg=20is=20not=20set=20by=20open=20sourc?= =?UTF-8?q?e=20or=20AIStor,=20we=20should=20remove=20this=20an=E2=80=A6=20?= =?UTF-8?q?(#5186)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ConsoleMsg is not set by open source or eos, we should remove this and correctly show Message only --- cmd/admin-logs.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/cmd/admin-logs.go b/cmd/admin-logs.go index cb53ba7b..72270d5a 100644 --- a/cmd/admin-logs.go +++ b/cmd/admin-logs.go @@ -107,15 +107,6 @@ func (l logMessage) String() string { if l.NodeName != "" { hostStr = fmt.Sprintf("%s ", colorizedNodeName(l.NodeName)) } - log := l.LogInfo - if log.ConsoleMsg != "" { - if strings.HasPrefix(log.ConsoleMsg, "\n") { - fmt.Fprintf(b, "%s\n", hostStr) - log.ConsoleMsg = strings.TrimPrefix(log.ConsoleMsg, "\n") - } - fmt.Fprintf(b, "%s %s", hostStr, log.ConsoleMsg) - return b.String() - } if l.API != nil { apiString := "API: " + l.API.Name + "(" if l.API.Args != nil && l.API.Args.Bucket != "" { @@ -142,6 +133,9 @@ func (l logMessage) String() string { if l.UserAgent != "" { fmt.Fprintf(b, "\n%s UserAgent: %s", hostStr, l.UserAgent) } + if l.Message != "" { + fmt.Fprintf(b, "\n%s Message: %s", hostStr, l.Message) + } if l.Trace != nil { if l.Trace.Message != "" { fmt.Fprintf(b, "\n%s Error: %s", hostStr, console.Colorize("LogMessage", l.Trace.Message))