Make sure the debug log contains line breaks

Many debug logs have no line breaks, so fix them here.
This commit is contained in:
henrylee2cn 2018-11-19 16:05:37 +08:00 committed by GitHub
parent d6b2c13b18
commit fc0685ba5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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