Improves unit tests
This commit is contained in:
9
debug.go
9
debug.go
@ -4,7 +4,12 @@
|
||||
|
||||
package gin
|
||||
|
||||
import "log"
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
var debugLogger = log.New(os.Stdout, "[GIN-debug] ", 0)
|
||||
|
||||
func IsDebugging() bool {
|
||||
return ginMode == debugCode
|
||||
@ -20,6 +25,6 @@ func debugRoute(httpMethod, absolutePath string, handlers []HandlerFunc) {
|
||||
|
||||
func debugPrint(format string, values ...interface{}) {
|
||||
if IsDebugging() {
|
||||
log.Printf("[GIN-debug] "+format, values...)
|
||||
debugLogger.Printf(format, values...)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user