MCPcopy
hub / github.com/FloatTech/ZeroBot-Plugin / Format

Method Format

abineundo/console_windows.go:115–131  ·  view source on GitHub ↗

Format implements logrus.Formatter

(entry *logrus.Entry)

Source from the content-addressed store, hash-verified

113
114// Format implements logrus.Formatter
115func (f logFormat) Format(entry *logrus.Entry) ([]byte, error) {
116 buf := new(bytes.Buffer)
117
118 buf.WriteByte('[')
119 if f.hasColor {
120 buf.WriteString(getLogLevelColorCode(entry.Level))
121 }
122 buf.WriteString(strings.ToUpper(entry.Level.String()))
123 if f.hasColor {
124 buf.WriteString(colorReset)
125 }
126 buf.WriteString("] ")
127 buf.WriteString(entry.Message)
128 buf.WriteString(" \n")
129
130 return buf.Bytes(), nil
131}
132
133// getLogLevelColorCode 获取日志等级对应色彩code
134func getLogLevelColorCode(level logrus.Level) string {

Callers 15

initFunction · 0.80
initFunction · 0.80
initFunction · 0.80
initFunction · 0.80
initFunction · 0.80
开门时间Method · 0.80
登记Method · 0.80
drawScore16Function · 0.80
drawScore15Function · 0.80
drawScore17Function · 0.80
customtextFunction · 0.80
initFunction · 0.80

Calls 2

getLogLevelColorCodeFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected