github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/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  }