summaryrefslogtreecommitdiff
path: root/internal/log/log.go
diff options
context:
space:
mode:
authorJeroen Wijenbergh <jeroen.wijenbergh@geant.org>2025-05-06 14:33:54 +0200
committerJeroen Wijenbergh <jeroen.wijenbergh@geant.org>2025-05-06 16:40:26 +0200
commitc18e5071f6d073f701dd45b31e481f2bac8ec0d8 (patch)
treefe9601028b95a4702183415e62a86c8cdc240454 /internal/log/log.go
parent3f0c2643b4caadd3a47201caa2c6acba2585241d (diff)
Failover + Log: Small slog fixes
Diffstat (limited to 'internal/log/log.go')
-rw-r--r--internal/log/log.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/log/log.go b/internal/log/log.go
index d4a9bf5..47cdcf3 100644
--- a/internal/log/log.go
+++ b/internal/log/log.go
@@ -13,6 +13,9 @@ import (
// Init initializes the logger by setting a max level 'level' and a directory 'directory' where the log should be stored
// internally, it uses slog, so any package just imports slog
+// This can be done as this function sets the logger as the default logger in slog
+// It returns the log file and the error
+// This log file should be closed at the end
func Init(lvl slog.Level, dir string) (*os.File, error) {
err := util.EnsureDirectory(dir)
if err != nil {