mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-20 13:53:19 +02:00
lnd: fix debuglevel bug.
We need to setup the loggers before we are able to show the complete list of available subsystems.
This commit is contained in:
parent
027de0a82c
commit
8bb79d10e9
14
config.go
14
config.go
@ -1406,13 +1406,6 @@ func ValidateConfig(cfg Config, interceptor signal.Interceptor, fileParser,
|
|||||||
return nil, mkErr("log writer missing in config")
|
return nil, mkErr("log writer missing in config")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Special show command to list supported subsystems and exit.
|
|
||||||
if cfg.DebugLevel == "show" {
|
|
||||||
fmt.Println("Supported subsystems",
|
|
||||||
cfg.LogWriter.SupportedSubsystems())
|
|
||||||
os.Exit(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !build.SuportedLogCompressor(cfg.LogCompressor) {
|
if !build.SuportedLogCompressor(cfg.LogCompressor) {
|
||||||
return nil, mkErr("invalid log compressor: %v",
|
return nil, mkErr("invalid log compressor: %v",
|
||||||
cfg.LogCompressor)
|
cfg.LogCompressor)
|
||||||
@ -1420,6 +1413,13 @@ func ValidateConfig(cfg Config, interceptor signal.Interceptor, fileParser,
|
|||||||
|
|
||||||
// Initialize logging at the default logging level.
|
// Initialize logging at the default logging level.
|
||||||
SetupLoggers(cfg.LogWriter, interceptor)
|
SetupLoggers(cfg.LogWriter, interceptor)
|
||||||
|
|
||||||
|
// Special show command to list supported subsystems and exit.
|
||||||
|
if cfg.DebugLevel == "show" {
|
||||||
|
fmt.Println("Supported subsystems",
|
||||||
|
cfg.LogWriter.SupportedSubsystems())
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
err = cfg.LogWriter.InitLogRotator(
|
err = cfg.LogWriter.InitLogRotator(
|
||||||
filepath.Join(cfg.LogDir, defaultLogFilename),
|
filepath.Join(cfg.LogDir, defaultLogFilename),
|
||||||
cfg.LogCompressor, cfg.MaxLogFileSize, cfg.MaxLogFiles,
|
cfg.LogCompressor, cfg.MaxLogFileSize, cfg.MaxLogFiles,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user