all, lib/logger: Refactor SetDebug calls (#6054)
This commit is contained in:
committed by
Simon Frei
parent
8fb576ed54
commit
96bb1c8e29
@@ -7,9 +7,6 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/syncthing/syncthing/lib/logger"
|
||||
)
|
||||
|
||||
@@ -24,5 +21,7 @@ func shouldDebugHTTP() bool {
|
||||
func init() {
|
||||
// The debug facility was originally named "http", changed in:
|
||||
// https://github.com/syncthing/syncthing/pull/5548
|
||||
l.SetDebug("api", strings.Contains(os.Getenv("STTRACE"), "api") || strings.Contains(os.Getenv("STTRACE"), "http") || os.Getenv("STTRACE") == "all")
|
||||
if l.IsTraced("http") {
|
||||
l.SetDebug("api", true)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user