Skip to content

Commit

Permalink
allow flag overwrite config
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Nov 8, 2023
1 parent 5174bc2 commit a692537
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/appstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ func (a *appState) loadConfigFile(ctx context.Context) error {
return fmt.Errorf("error unmarshalling config: %w", err)
}
if a.log == nil {
log, err := newRootLogger(a.viper.GetString("log-format"), cfgWrapper.Global.LogLevel)
logLevel := a.viper.GetString("log-level")
if logLevel == "" {
logLevel = cfgWrapper.Global.LogLevel
}
log, err := newRootLogger(a.viper.GetString("log-format"), logLevel)
if err != nil {
return err
}
Expand Down

0 comments on commit a692537

Please sign in to comment.