Jelajahi Sumber

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.
henrylee2cn 7 tahun lalu
induk
melakukan
3d44ff82a1
1 mengubah file dengan 3 tambahan dan 0 penghapusan
  1. 3 0
      debug.go

+ 3 - 0
debug.go

@@ -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...)
 	}
 	}
 }
 }