Improves unit tests

This commit is contained in:
Manu Mtz-Almeida
2015-04-08 02:58:35 +02:00
parent 67f8f6bb69
commit ac0ad2fed8
14 changed files with 784 additions and 624 deletions

View File

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