Skip to content

Commit

Permalink
Update server/logging.go test logic
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Espino García <[email protected]>
  • Loading branch information
willypuzzle and larkox authored Dec 5, 2024
1 parent 02a6b10 commit a0546f8
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions server/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,10 @@ func NewMlogLogger(cfg *ConfigPushProxy) (*mlog.Logger, error) {
}

func defaultLoggingConfig(cfg *ConfigPushProxy) string {
if !cfg.EnableFileLog && !cfg.EnableConsoleLog {
return defaultLoggingConsoleLogConfig()
} else if cfg.EnableFileLog && !cfg.EnableConsoleLog {
if cfg.LogFileLocation == "" {
return defaultLoggingConsoleLogConfig()
}
return defaultLoggingFileLogConfig(cfg.LogFileLocation)
} else if !cfg.EnableFileLog && cfg.EnableConsoleLog {
return defaultLoggingConsoleLogConfig()
} else {
if cfg.LogFileLocation == "" {
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 a0546f8

Please sign in to comment.