1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-05 07:50:24 +08:00

fix some error

This commit is contained in:
fumiama
2021-12-29 23:46:50 +08:00
parent e6b19e093b
commit cdb15b4352
6 changed files with 38 additions and 34 deletions

View File

@@ -32,17 +32,13 @@ type LogFormat struct{}
// Format implements logrus.Formatter
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
}