mirror of
https://github.com/gin-gonic/gin.git
synced 2025-05-20 17:06:24 +08:00
Solution for Google App Engine?
https://cloud.google.com/appengine/docs/go/logs/
This commit is contained in:
12
debug.go
12
debug.go
@ -4,13 +4,11 @@
|
||||
|
||||
package gin
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
var debugLogger = log.New(os.Stdout, "[GIN-debug] ", 0)
|
||||
import "log"
|
||||
|
||||
func init() {
|
||||
log.SetFlags(0)
|
||||
}
|
||||
func IsDebugging() bool {
|
||||
return ginMode == debugCode
|
||||
}
|
||||
@ -25,7 +23,7 @@ func debugPrintRoute(httpMethod, absolutePath string, handlers HandlersChain) {
|
||||
|
||||
func debugPrint(format string, values ...interface{}) {
|
||||
if IsDebugging() {
|
||||
debugLogger.Printf(format, values...)
|
||||
log.Printf("[GIN-debug] "+format, values...)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user