all, lib/logger: Refactor SetDebug calls (#6054)

This commit is contained in:
Lukas Lihotzki
2019-10-04 13:03:34 +02:00
committed by Simon Frei
parent 8fb576ed54
commit 96bb1c8e29
27 changed files with 16 additions and 176 deletions

View File

@@ -7,18 +7,9 @@
package watchaggregator
import (
"os"
"strings"
"github.com/syncthing/syncthing/lib/logger"
)
var facilityName = "watchaggregator"
var (
l = logger.DefaultLogger.NewFacility(facilityName, "Filesystem event watcher")
l = logger.DefaultLogger.NewFacility("watchaggregator", "Filesystem event watcher")
)
func init() {
l.SetDebug(facilityName, strings.Contains(os.Getenv("STTRACE"), facilityName) || os.Getenv("STTRACE") == "all")
}