@@ -180,13 +180,6 @@ func Run(rpcCfg RPCConfig) error {
180180 os .Exit (0 )
181181 }
182182
183- // Special show command to list supported subsystems and exit.
184- if config .DebugLevel == "show" {
185- fmt .Printf ("Supported subsystems: %v\n " ,
186- logWriter .SupportedSubsystems ())
187- os .Exit (0 )
188- }
189-
190183 // Validate our config before we proceed.
191184 if err := Validate (& config ); err != nil {
192185 return err
@@ -202,17 +195,25 @@ func Run(rpcCfg RPCConfig) error {
202195 }
203196
204197 // Initialize logging at the default logging level.
205- logWriter := build .NewRotatingLogWriter ()
206- SetupLoggers (logWriter , shutdownInterceptor )
198+ logger := build .NewRotatingLogWriter ()
199+ SetupLoggers (logger , shutdownInterceptor )
200+
201+ // Special show command to list supported subsystems and exit.
202+ if config .DebugLevel == "show" {
203+ fmt .Printf ("Supported subsystems: %v\n " ,
204+ logger .SupportedSubsystems ())
205+
206+ os .Exit (0 )
207+ }
207208
208- err = logWriter .InitLogRotator (
209+ err = logger .InitLogRotator (
209210 filepath .Join (config .LogDir , defaultLogFilename ),
210211 config .MaxLogFileSize , config .MaxLogFiles ,
211212 )
212213 if err != nil {
213214 return err
214215 }
215- err = build .ParseAndSetDebugLevels (config .DebugLevel , logWriter )
216+ err = build .ParseAndSetDebugLevels (config .DebugLevel , logger )
216217 if err != nil {
217218 return err
218219 }
0 commit comments