feat: replace debug log with fmt package. (#1560)

This commit is contained in:
Bo-Yi Wu
2018-09-19 13:57:00 +08:00
committed by GitHub
parent b27b7026c7
commit 07f1bf0e63
3 changed files with 86 additions and 74 deletions

View File

@ -6,14 +6,10 @@ package gin
import (
"bytes"
"fmt"
"html/template"
"log"
)
func init() {
log.SetFlags(0)
}
// IsDebugging returns true if the framework is running in debug mode.
// Use SetMode(gin.ReleaseMode) to disable debug mode.
func IsDebugging() bool {
@ -48,7 +44,7 @@ func debugPrintLoadTemplate(tmpl *template.Template) {
func debugPrint(format string, values ...interface{}) {
if IsDebugging() {
log.Printf("[GIN-debug] "+format, values...)
fmt.Printf("[GIN-debug] "+format, values...)
}
}