From 1a633354982d8917dcf6c71021d57aa7f43ffb39 Mon Sep 17 00:00:00 2001 From: Charles Iliya Krempeaux Date: Thu, 15 Oct 2015 17:59:07 -0700 Subject: [PATCH] tweaked what pretty printer does. --- pretty_writing_router.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pretty_writing_router.go b/pretty_writing_router.go index 5165751..28df3f0 100644 --- a/pretty_writing_router.go +++ b/pretty_writing_router.go @@ -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