Skip to content

Commit

Permalink
Refactor logging configuration logic
Browse files Browse the repository at this point in the history
The logging configuration logic has been refactored for better readability. The changes mainly involve reformatting the conditionals that determine whether to use console or file log configurations.
  • Loading branch information
willypuzzle committed Dec 5, 2024
1 parent a0546f8 commit ef2d621
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ func NewMlogLogger(cfg *ConfigPushProxy) (*mlog.Logger, error) {
}

func defaultLoggingConfig(cfg *ConfigPushProxy) string {
if (cfg.LogFileLocation == "" || !cfg.EnableFileLog) {
return defaultLoggingConsoleLogConfig()
}
return defaultLoggingFileLogConfig(cfg.LogFileLocation)
if cfg.LogFileLocation == "" || !cfg.EnableFileLog {
return defaultLoggingConsoleLogConfig()
}
return defaultLoggingFileLogConfig(cfg.LogFileLocation)
}

func defaultLoggingFileLogConfig(filename string) string {
Expand Down

0 comments on commit ef2d621

Please sign in to comment.