From c18e5071f6d073f701dd45b31e481f2bac8ec0d8 Mon Sep 17 00:00:00 2001 From: Jeroen Wijenbergh Date: Tue, 6 May 2025 14:33:54 +0200 Subject: Failover + Log: Small slog fixes --- internal/log/log.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'internal/log/log.go') 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 { -- cgit v1.2.3