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.
This commit is contained in:
henrylee2cn 2018-11-22 09:07:00 +08:00 committed by Bo-Yi Wu
parent d6b2c13b18
commit 3d44ff82a1

View File

@ -51,6 +51,9 @@ func debugPrintLoadTemplate(tmpl *template.Template) {
func debugPrint(format string, values ...interface{}) { func debugPrint(format string, values ...interface{}) {
if IsDebugging() { if IsDebugging() {
if !strings.HasSuffix(format, "\n") {
format += "\n"
}
fmt.Fprintf(os.Stderr, "[GIN-debug] "+format, values...) fmt.Fprintf(os.Stderr, "[GIN-debug] "+format, values...)
} }
} }