lnd: properly initialize LightningWallet with new config
This commit is contained in:
3 files changed
+34
-14
No files matched your search
@@ -36,20 +36,21 @@ func (logWriter) Write(p []byte) (n int, err error) {
|
||||
// subsystemLoggers map.
|
||||
//
|
||||
// Loggers can not be used before the log rotator has been initialized with a
|
||||
// log file. This must be performed early during application startup by calling
|
||||
// initLogRotator.
|
||||
// log file. This must be performed early during application startup by
|
||||
// calling initLogRotator.
|
||||
var (
|
||||
// backendLog is the logging backend used to create all subsystem loggers.
|
||||
// The backend must not be used before the log rotator has been initialized,
|
||||
// or data races and/or nil pointer dereferences will occur.
|
||||
// backendLog is the logging backend used to create all subsystem
|
||||
// loggers. The backend must not be used before the log rotator has
|
||||
// been initialized, or data races and/or nil pointer dereferences will
|
||||
// occur.
|
||||
backendLog = btclog.NewBackend(logWriter{})
|
||||
|
||||
// logRotator is one of the logging outputs. It should be closed on
|
||||
// application shutdown.
|
||||
logRotator *rotator.Rotator
|
||||
|
||||
// logRotatorPipe is the write-end pipe for writing to the log rotator. It
|
||||
// is written to by the Write method of the logWriter type.
|
||||
// logRotatorPipe is the write-end pipe for writing to the log rotator.
|
||||
// It is written to by the Write method of the logWriter type.
|
||||
logRotatorPipe *io.PipeWriter
|
||||
|
||||
ltndLog = backendLog.Logger("LTND")
|
||||
@@ -100,9 +101,9 @@ var subsystemLoggers = map[string]btclog.Logger{
|
||||
"BTCN": btcnLog,
|
||||
}
|
||||
|
||||
// initLogRotator initializes the logging rotater to write logs to logFile and
|
||||
// initLogRotator initializes the logging rotator to write logs to logFile and
|
||||
// create roll files in the same directory. It must be called before the
|
||||
// package-global log rotater variables are used.
|
||||
// package-global log rotator variables are used.
|
||||
func initLogRotator(logFile string) {
|
||||
logDir, _ := filepath.Split(logFile)
|
||||
err := os.MkdirAll(logDir, 0700)
|
||||
@@ -149,8 +150,8 @@ func setLogLevels(logLevel string) {
|
||||
}
|
||||
}
|
||||
|
||||
// logClosure is used to provide a closure over expensive logging operations
|
||||
// so don't have to be performed when the logging level doesn't warrant it.
|
||||
// logClosure is used to provide a closure over expensive logging operations so
|
||||
// don't have to be performed when the logging level doesn't warrant it.
|
||||
type logClosure func() string
|
||||
|
||||
// String invokes the underlying function and returns the result.
|
||||
|
||||
Reference in new issue
Block a user