github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/logger/global.go (about)

     1  package logger
     2  
     3  import (
     4  	"github.com/keybase/go-logging"
     5  	"github.com/mattn/go-isatty"
     6  	"os"
     7  	"sync"
     8  )
     9  
    10  var globalLock sync.Mutex
    11  var stderrIsTerminal = isatty.IsTerminal(os.Stderr.Fd())
    12  var currentLogFileWriter *LogFileWriter
    13  var stdErrLoggingShutdown chan<- struct{}
    14  var stdErrLoggingShutdownDone <-chan struct{}
    15  
    16  func init() {
    17  	logBackend := logging.NewLogBackend(ErrorWriter(), "", 0)
    18  	logging.SetBackend(logBackend)
    19  }