From d8f05538bc751b4a9c7c2216ac56b404b9ff1918 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 26 Sep 2018 09:32:29 +0800 Subject: [PATCH] fix: output log to os.Stderr --- debug.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debug.go b/debug.go index ce908dc7e8..e58725cfbb 100644 --- a/debug.go +++ b/debug.go @@ -8,6 +8,7 @@ import ( "bytes" "fmt" "html/template" + "os" ) // IsDebugging returns true if the framework is running in debug mode. @@ -45,7 +46,7 @@ func debugPrintLoadTemplate(tmpl *template.Template) { func debugPrint(format string, values ...interface{}) { if IsDebugging() { - fmt.Printf("[GIN-debug] "+format, values...) + fmt.Fprintf(os.Stderr, "[GIN-debug] "+format, values...) } }