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 fs
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/syncthing/syncthing/lib/logger"
|
||||
)
|
||||
|
||||
@@ -19,11 +16,7 @@ var (
|
||||
|
||||
func init() {
|
||||
logger.DefaultLogger.NewFacility("walkfs", "Filesystem access while walking")
|
||||
switch {
|
||||
case strings.Contains(os.Getenv("STTRACE"), "walkfs") || os.Getenv("STTRACE") == "all":
|
||||
l.SetDebug("walkfs", true)
|
||||
fallthrough
|
||||
case strings.Contains(os.Getenv("STTRACE"), "fs"):
|
||||
if logger.DefaultLogger.ShouldDebug("walkfs") {
|
||||
l.SetDebug("fs", true)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user