1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-24 21:00:49 +08:00
This commit is contained in:
fumiama
2021-12-31 19:47:52 +08:00
parent 74b788fe7f
commit 2761865178
4 changed files with 20 additions and 6 deletions

View File

@@ -32,11 +32,9 @@ type LogFormat struct{}
// Format implements logrus.Formatter
func (f LogFormat) Format(entry *logrus.Entry) ([]byte, error) {
buf := new(bytes.Buffer)
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")
return buf.Bytes(), nil