multi: rename and export logWriter as RootLogWriter

This commit is contained in:
Oliver Gugger
2020-05-13 15:04:57 +02:00
parent a56ca0d0cf
commit bc3909050e
4 changed files with 20 additions and 18 deletions

View File

@@ -971,12 +971,12 @@ func ValidateConfig(cfg Config, usageMessage string) (*Config, error) {
// Special show command to list supported subsystems and exit.
if cfg.DebugLevel == "show" {
fmt.Println("Supported subsystems",
logWriter.SupportedSubsystems())
RootLogWriter.SupportedSubsystems())
os.Exit(0)
}
// Initialize logging at the default logging level.
err = logWriter.InitLogRotator(
err = RootLogWriter.InitLogRotator(
filepath.Join(cfg.LogDir, defaultLogFilename),
cfg.MaxLogFileSize, cfg.MaxLogFiles,
)
@@ -988,7 +988,7 @@ func ValidateConfig(cfg Config, usageMessage string) (*Config, error) {
}
// Parse, validate, and set debug log level(s).
err = build.ParseAndSetDebugLevels(cfg.DebugLevel, logWriter)
err = build.ParseAndSetDebugLevels(cfg.DebugLevel, RootLogWriter)
if err != nil {
err = fmt.Errorf("%s: %v", funcName, err.Error())
_, _ = fmt.Fprintln(os.Stderr, err)