debug.go 342 B

123456789101112131415161718
  1. // Copyright (C) 2014 The Protocol Authors.
  2. package protocol
  3. import (
  4. "os"
  5. "strings"
  6. "github.com/syncthing/syncthing/lib/logger"
  7. )
  8. var (
  9. l = logger.DefaultLogger.NewFacility("protocol", "The BEP protocol")
  10. )
  11. func init() {
  12. l.SetDebug("protocol", strings.Contains(os.Getenv("STTRACE"), "protocol") || os.Getenv("STTRACE") == "all")
  13. }