From 3d44ff82a1fe39b5991f292369eed0d6abf2a430 Mon Sep 17 00:00:00 2001 From: henrylee2cn Date: Thu, 22 Nov 2018 09:07:00 +0800 Subject: [PATCH] Make sure the debug log contains line breaks (#1650) Many debug logs have no line breaks, so fix them here. - With pull requests: - Open your pull request against `master` - Your pull request should have no more than two commits, if not you should squash them. - It should pass all tests in the available continuous integrations systems such as TravisCI. - You should add/modify tests to cover your proposed code changes. - If your pull request contains a new feature, please document it on the README. --- 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...) } }