Skip to content

Commit

Permalink
kwild/config: rootify relative log paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jchappelow authored and brennanjl committed Feb 26, 2024
1 parent 0d26bcf commit 91e2b22
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cmd/kwild/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,20 @@ func DefaultConfig() *KwildConfig {
}

func (cfg *KwildConfig) LogConfig() *log.Config {
// Rootify any relative paths.
outputPaths := make([]string, 0, len(cfg.Logging.OutputPaths))
for _, path := range cfg.Logging.OutputPaths {
switch path {
case "stdout", "stderr":
outputPaths = append(outputPaths, path)
default:
outputPaths = append(outputPaths, rootify(path, cfg.RootDir))
}
}
// log.Config <== config.Logging
return &log.Config{
Level: cfg.Logging.Level,
OutputPaths: cfg.Logging.OutputPaths,
OutputPaths: outputPaths,
Format: cfg.Logging.Format,
EncodeTime: cfg.Logging.TimeEncoding,
}
Expand Down

0 comments on commit 91e2b22

Please sign in to comment.