Adds debug mode (part 1)

- Adds API to switch the gin's mode
- Log listening port
- Log routes
This commit is contained in:
Manu Mtz-Almeida
2014-08-19 03:40:52 +02:00
parent 312e032960
commit 809eee8a72
3 changed files with 56 additions and 0 deletions

View File

@ -2,6 +2,8 @@ package gin
import (
"encoding/xml"
"reflect"
"runtime"
)
type H map[string]interface{}
@ -38,3 +40,7 @@ func filterFlags(content string) string {
}
return content
}
func funcName(f interface{}) string {
return runtime.FuncForPC(reflect.ValueOf(f).Pointer()).Name()
}