From 7df950983d204a7e0d0e307890957eadac91e1f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kintzi?= Date: Sat, 11 Nov 2023 19:24:14 +0100 Subject: [PATCH] Set slog.DefaultLogger() --- cmds/statusbar/main.go | 2 ++ statusbar.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmds/statusbar/main.go b/cmds/statusbar/main.go index 24f5ef9..bbfbc7d 100644 --- a/cmds/statusbar/main.go +++ b/cmds/statusbar/main.go @@ -2,6 +2,7 @@ package main import ( "fmt" + "log/slog" "os" "gobytes.dev/statusbar" @@ -10,6 +11,7 @@ import ( func main() { cfg := statusbar.Configuration{} + cfg.SetLogger(slog.Default()) err := cfg.Run(nil) abortOnErr(err) } diff --git a/statusbar.go b/statusbar.go index 8330783..58b43d7 100644 --- a/statusbar.go +++ b/statusbar.go @@ -54,7 +54,7 @@ func New(ws ...Widget) *StatusBar { return b } -func (b StatusBar) SetLogger(l *slog.Logger) { b.logger = l } +func (b *StatusBar) SetLogger(l *slog.Logger) { b.logger = l } func (b *StatusBar) Run(ctx context.Context) { b.openLogFile() -- 2.45.2