Merge branch 'discours-dev' into discours
All checks were successful
deploy / deploy (push) Successful in 2m5s
All checks were successful
deploy / deploy (push) Successful in 2m5s
This commit is contained in:
commit
c125c89fbf
|
@ -34,11 +34,16 @@ func (u LogTextFormatter) Format(e *logrus.Entry) ([]byte, error) {
|
|||
color = "\033[0m" // reset
|
||||
}
|
||||
|
||||
var fields string
|
||||
for key, value := range e.Data {
|
||||
fields += fmt.Sprintf("%s=%v ", key, value)
|
||||
}
|
||||
|
||||
if e.Caller != nil {
|
||||
file := filepath.Base(e.Caller.File)
|
||||
line := e.Caller.Line
|
||||
return []byte(fmt.Sprintf("%s[%s] %s:%d %s%s\033[0m\n", color, level, file, line, message, color)), nil
|
||||
return []byte(fmt.Sprintf("%s[%s] %s:%d %s %s%s\033[0m\n", color, level, file, line, message, fields, color)), nil
|
||||
}
|
||||
|
||||
return []byte(fmt.Sprintf("%s[%s] %s%s\033[0m\n", color, level, message, color)), nil
|
||||
return []byte(fmt.Sprintf("%s[%s] %s %s%s\033[0m\n", color, level, message, fields, color)), nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user