/ monitoring / log.go
log.go
 1  package monitoring
 2  
 3  import (
 4  	"github.com/btcsuite/btclog/v2"
 5  	"github.com/lightningnetwork/lnd/build"
 6  )
 7  
 8  // log is a logger that is initialized with no output filters.  This means the
 9  // package will not perform any logging by default until the caller requests
10  // it.
11  var log btclog.Logger
12  
13  // The default amount of logging is none.
14  func init() {
15  	UseLogger(build.NewSubLogger("PROM", nil))
16  }
17  
18  // DisableLog disables all library log output.  Logging output is disabled by
19  // default until UseLogger is called.
20  func DisableLog() {
21  	UseLogger(btclog.Disabled)
22  }
23  
24  // UseLogger uses a specified Logger to output package logging info.  This
25  // should be used in preference to SetLogWriter if the caller is also using
26  // btclog.
27  func UseLogger(logger btclog.Logger) {
28  	log = logger
29  }