From f9c59a71316aa0f244a90e2564cdcb975e8c74b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ko=C5=82odziejczak?= <31549762+mrl5@users.noreply.github.com> Date: Tue, 16 Jul 2024 11:50:35 +0200 Subject: [PATCH] Refactor log util (#2276) --- util/log.go | 4 ++-- util/syslog_windows.go | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/util/log.go b/util/log.go index 11bb7efa7..74b99311e 100644 --- a/util/log.go +++ b/util/log.go @@ -19,9 +19,9 @@ func InitLog(logLevel string, logPath string) error { log.Errorf("Failed parsing log-level %s: %s", logLevel, err) return err } - custom_outputs := []string{"console", "syslog"}; + customOutputs := []string{"console", "syslog"}; - if logPath != "" && !slices.Contains(custom_outputs, logPath) { + if logPath != "" && !slices.Contains(customOutputs, logPath) { lumberjackLogger := &lumberjack.Logger{ // Log file absolute path, os agnostic Filename: filepath.ToSlash(logPath), diff --git a/util/syslog_windows.go b/util/syslog_windows.go index a38d90054..171c1a459 100644 --- a/util/syslog_windows.go +++ b/util/syslog_windows.go @@ -1,3 +1,6 @@ package util -func AddSyslogHook() {} +func AddSyslogHook() { + // The syslog package is not available for Windows. This adapter is needed + // to handle windows build. +}