From fc0685ba5c0e0a7b5e2e83cd95a79720a6a1dbb8 Mon Sep 17 00:00:00 2001 From: henrylee2cn Date: Mon, 19 Nov 2018 16:05:37 +0800 Subject: [PATCH] Make sure the debug log contains line breaks Many debug logs have no line breaks, so fix them here. --- debug.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debug.go b/debug.go index c5e65b22..98c67cf7 100644 --- a/debug.go +++ b/debug.go @@ -51,6 +51,9 @@ func debugPrintLoadTemplate(tmpl *template.Template) { func debugPrint(format string, values ...interface{}) { if IsDebugging() { + if !strings.HasSuffix(format, "\n") { + format += "\n" + } fmt.Fprintf(os.Stderr, "[GIN-debug] "+format, values...) } }