lib/logger: Reduce API surface (#9404)

There is no need to expose the IsTraced() thing; it's just used in
initialisation, and thereafter ShouldDebug() is the corresponding
correct call.
This commit is contained in:
Jakob Borg
2024-02-09 11:17:44 +01:00
committed by GitHub
parent 9f6d732587
commit 416b9e8924
2 changed files with 6 additions and 15 deletions
+1 -11
View File
@@ -10,18 +10,8 @@ import (
"github.com/syncthing/syncthing/lib/logger"
)
var (
l = logger.DefaultLogger.NewFacility("api", "REST API")
)
var l = logger.DefaultLogger.NewFacility("api", "REST API")
func shouldDebugHTTP() bool {
return l.ShouldDebug("api")
}
func init() {
// The debug facility was originally named "http", changed in:
// https://github.com/syncthing/syncthing/pull/5548
if l.IsTraced("http") {
l.SetDebug("api", true)
}
}