summaryrefslogtreecommitdiff
path: root/internal/log/log.go
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2023-02-28 10:37:00 +0100
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2023-02-28 10:37:00 +0100
commit15cb268440b54bcbdcae9d64e1d5d083e99d74e7 (patch)
tree6450b9a01de01d8c85e8e2a25c525358b121b959 /internal/log/log.go
parent1557593401acaca1bac696195794103fcda07538 (diff)
Log: Use a global logger instance
Diffstat (limited to 'internal/log/log.go')
-rw-r--r--internal/log/log.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/log/log.go b/internal/log/log.go
index 2fb2444..16cf1fd 100644
--- a/internal/log/log.go
+++ b/internal/log/log.go
@@ -47,6 +47,9 @@ type FileLogger struct {
file *os.File
}
+// Logger is the global logger instance
+var Logger *FileLogger
+
type Level int8
const (
@@ -174,3 +177,7 @@ func (logger *FileLogger) log(lvl Level, msg string, params ...interface{}) {
log.Println(f)
}
}
+
+func init() {
+ Logger = &FileLogger{}
+}