mirror of
https://github.com/netbirdio/netbird.git
synced 2025-02-17 18:51:21 +01:00
Refactor log util (#2276)
This commit is contained in:
parent
1d6f5482dd
commit
f9c59a7131
@ -19,9 +19,9 @@ func InitLog(logLevel string, logPath string) error {
|
|||||||
log.Errorf("Failed parsing log-level %s: %s", logLevel, err)
|
log.Errorf("Failed parsing log-level %s: %s", logLevel, err)
|
||||||
return 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{
|
lumberjackLogger := &lumberjack.Logger{
|
||||||
// Log file absolute path, os agnostic
|
// Log file absolute path, os agnostic
|
||||||
Filename: filepath.ToSlash(logPath),
|
Filename: filepath.ToSlash(logPath),
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
package util
|
package util
|
||||||
|
|
||||||
func AddSyslogHook() {}
|
func AddSyslogHook() {
|
||||||
|
// The syslog package is not available for Windows. This adapter is needed
|
||||||
|
// to handle windows build.
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user