tweaked what pretty printer does.
parent
faa62bdadd
commit
1a63335498
|
@ -66,8 +66,7 @@ func (router *PrettyWritingRouter) Route(message string, context map[string]inte
|
||||||
// If we have an error, then get the error.Error() into the log too.
|
// If we have an error, then get the error.Error() into the log too.
|
||||||
if errorFieldValue, ok := context["~error"]; ok {
|
if errorFieldValue, ok := context["~error"]; ok {
|
||||||
if err, ok := errorFieldValue.(error); ok {
|
if err, ok := errorFieldValue.(error); ok {
|
||||||
context["~~error"] = err.Error()
|
context["~~error"] = fmt.Sprintf("%s, {{%T}}", err.Error(), err)
|
||||||
context["~~errorType"] = fmt.Sprintf("%T", err)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +93,7 @@ func (router *PrettyWritingRouter) Route(message string, context map[string]inte
|
||||||
style = STYLE_FATAL
|
style = STYLE_FATAL
|
||||||
case "~panic", "~panics":
|
case "~panic", "~panics":
|
||||||
style = STYLE_PANIC
|
style = STYLE_PANIC
|
||||||
case "~error", "~errors", "~~error", "~~errorType":
|
case "~error", "~errors", "~~error":
|
||||||
style = STYLE_ERROR
|
style = STYLE_ERROR
|
||||||
case "~warning", "~warnings":
|
case "~warning", "~warnings":
|
||||||
style = STYLE_WARNING
|
style = STYLE_WARNING
|
||||||
|
|
Loading…
Reference in New Issue