|
|
@ -179,13 +179,6 @@ func Run(rpcCfg RPCConfig) error {
|
|
|
|
os.Exit(0)
|
|
|
|
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.
|
|
|
|
// Validate our config before we proceed.
|
|
|
|
if err := Validate(&config); err != nil {
|
|
|
|
if err := Validate(&config); err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
@ -204,6 +197,13 @@ func Run(rpcCfg RPCConfig) error {
|
|
|
|
logWriter := build.NewRotatingLogWriter()
|
|
|
|
logWriter := build.NewRotatingLogWriter()
|
|
|
|
SetupLoggers(logWriter, shutdownInterceptor)
|
|
|
|
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(
|
|
|
|
err = logWriter.InitLogRotator(
|
|
|
|
filepath.Join(config.LogDir, defaultLogFilename),
|
|
|
|
filepath.Join(config.LogDir, defaultLogFilename),
|
|
|
|
config.MaxLogFileSize, config.MaxLogFiles,
|
|
|
|
config.MaxLogFileSize, config.MaxLogFiles,
|
|
|
|