HTTP debug middleware should be behind ShouldDebug()

This commit is contained in:
Jakob Borg
2015-11-21 09:39:40 +01:00
parent 945ddc2403
commit f7ad97918a
2 changed files with 20 additions and 14 deletions

View File

@@ -18,6 +18,10 @@ var (
httpl = logger.DefaultLogger.NewFacility("http", "REST API")
)
func shouldDebugHTTP() bool {
return l.ShouldDebug("http")
}
func init() {
l.SetDebug("main", strings.Contains(os.Getenv("STTRACE"), "main") || os.Getenv("STTRACE") == "all")
l.SetDebug("http", strings.Contains(os.Getenv("STTRACE"), "http") || os.Getenv("STTRACE") == "all")