From 8bb79d10e94fe6869ced516d7eef45345d773afe Mon Sep 17 00:00:00 2001 From: ziggie Date: Fri, 18 Oct 2024 12:45:19 +0200 Subject: [PATCH] lnd: fix debuglevel bug. We need to setup the loggers before we are able to show the complete list of available subsystems. --- config.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/config.go b/config.go index 601bdfe1f..2ad83c126 100644 --- a/config.go +++ b/config.go @@ -1406,13 +1406,6 @@ func ValidateConfig(cfg Config, interceptor signal.Interceptor, fileParser, 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) { return nil, mkErr("invalid log compressor: %v", cfg.LogCompressor) @@ -1420,6 +1413,13 @@ func ValidateConfig(cfg Config, interceptor signal.Interceptor, fileParser, // Initialize logging at the default logging level. 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( filepath.Join(cfg.LogDir, defaultLogFilename), cfg.LogCompressor, cfg.MaxLogFileSize, cfg.MaxLogFiles,