From 2704d3e7d4d310f60b6f3199a35f3a62fd463d27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Tue, 28 Feb 2023 12:15:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96color?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main_windows.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/main_windows.go b/main_windows.go index e32cd9ee..ac4d1f38 100644 --- a/main_windows.go +++ b/main_windows.go @@ -30,16 +30,14 @@ type LogFormat struct{} func (f LogFormat) Format(entry *logrus.Entry) ([]byte, error) { buf := new(bytes.Buffer) - buf.WriteString(getLogLevelColorCode(entry.Level)) - buf.WriteByte('[') + buf.WriteString(getLogLevelColorCode(entry.Level)) buf.WriteString(strings.ToUpper(entry.Level.String())) + buf.WriteString(colorReset) buf.WriteString("] ") buf.WriteString(entry.Message) buf.WriteString(" \n") - buf.WriteString(colorReset) - return buf.Bytes(), nil }