summaryrefslogtreecommitdiff
path: root/internal/log/log.go
diff options
context:
space:
mode:
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 {