This commit is contained in:
源文雨 2023-03-01 21:14:51 +08:00
parent 8f9a396821
commit 84bc79eaa6

View File

@ -106,11 +106,11 @@ func (f logFormat) Format(entry *logrus.Entry) ([]byte, error) {
buf := new(bytes.Buffer) buf := new(bytes.Buffer)
buf.WriteByte('[') buf.WriteByte('[')
if hasColor { if f.hasColor {
buf.WriteString(getLogLevelColorCode(entry.Level)) buf.WriteString(getLogLevelColorCode(entry.Level))
} }
buf.WriteString(strings.ToUpper(entry.Level.String())) buf.WriteString(strings.ToUpper(entry.Level.String()))
if hasColor { if f.hasColor {
buf.WriteString(colorReset) buf.WriteString(colorReset)
} }
buf.WriteString("] ") buf.WriteString("] ")