tweaked what pretty printer does.

master
Charles Iliya Krempeaux 2015-10-15 17:59:07 -07:00
parent faa62bdadd
commit 1a63335498
1 changed files with 2 additions and 3 deletions

View File

@ -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 errorFieldValue, ok := context["~error"]; ok {
if err, ok := errorFieldValue.(error); ok {
context["~~error"] = err.Error()
context["~~errorType"] = fmt.Sprintf("%T", err)
context["~~error"] = fmt.Sprintf("%s, {{%T}}", err.Error(), err)
}
}
@ -94,7 +93,7 @@ func (router *PrettyWritingRouter) Route(message string, context map[string]inte
style = STYLE_FATAL
case "~panic", "~panics":
style = STYLE_PANIC
case "~error", "~errors", "~~error", "~~errorType":
case "~error", "~errors", "~~error":
style = STYLE_ERROR
case "~warning", "~warnings":
style = STYLE_WARNING