From 172c076c4c7d588ed36ee9af4490a09f26a0e423 Mon Sep 17 00:00:00 2001 From: ziggie Date: Fri, 24 Mar 2023 16:07:16 +0100 Subject: [PATCH] loopd: nil-pointer bug when showing subsystems --- loopd/run.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/loopd/run.go b/loopd/run.go index 8dfcf9f..277d8dd 100644 --- a/loopd/run.go +++ b/loopd/run.go @@ -179,13 +179,6 @@ func Run(rpcCfg RPCConfig) error { os.Exit(0) } - // Special show command to list supported subsystems and exit. - if config.DebugLevel == "show" { - fmt.Printf("Supported subsystems: %v\n", - logWriter.SupportedSubsystems()) - os.Exit(0) - } - // Validate our config before we proceed. if err := Validate(&config); err != nil { return err @@ -204,6 +197,13 @@ func Run(rpcCfg RPCConfig) error { logWriter := build.NewRotatingLogWriter() SetupLoggers(logWriter, shutdownInterceptor) + // Special show command to list supported subsystems and exit. + if config.DebugLevel == "show" { + fmt.Printf("Supported subsystems: %v\n", + logWriter.SupportedSubsystems()) + os.Exit(0) + } + err = logWriter.InitLogRotator( filepath.Join(config.LogDir, defaultLogFilename), config.MaxLogFileSize, config.MaxLogFiles,