debug.go 607 B

123456789101112131415161718192021222324
  1. // Copyright (C) 2016 The Syncthing Authors.
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this file,
  5. // You can obtain one at http://mozilla.org/MPL/2.0/.
  6. package watchaggregator
  7. import (
  8. "os"
  9. "strings"
  10. "github.com/syncthing/syncthing/lib/logger"
  11. )
  12. var facilityName = "watchaggregator"
  13. var (
  14. l = logger.DefaultLogger.NewFacility(facilityName, "Filesystem event watcher")
  15. )
  16. func init() {
  17. l.SetDebug(facilityName, strings.Contains(os.Getenv("STTRACE"), facilityName) || os.Getenv("STTRACE") == "all")
  18. }