From 3f0c2643b4caadd3a47201caa2c6acba2585241d Mon Sep 17 00:00:00 2001 From: Jeroen Wijenbergh Date: Tue, 6 May 2025 14:33:54 +0200 Subject: All: Move to log/slog --- i18nerr/i18nerr.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'i18nerr') diff --git a/i18nerr/i18nerr.go b/i18nerr/i18nerr.go index 438b135..f16cf08 100644 --- a/i18nerr/i18nerr.go +++ b/i18nerr/i18nerr.go @@ -5,10 +5,10 @@ import ( "context" "errors" "fmt" + "log/slog" "sync" "codeberg.org/eduVPN/eduvpn-common/internal/http" - "codeberg.org/eduVPN/eduvpn-common/internal/log" "golang.org/x/text/language" "golang.org/x/text/message" @@ -102,12 +102,12 @@ func (e *Error) Unwrap() error { func printerOrNew(tag language.Tag) *message.Printer { v, ok := printers.Load(tag) if !ok { - log.Logger.Debugf("i18n: could not load printer with tag: '%v' from map", tag) + slog.Debug("i18n could not load printer from map", "tag", tag) return message.NewPrinter(tag) } p, ok := v.(*message.Printer) if !ok { - log.Logger.Debugf("i18n: could not load printer with tag: '%v' as the type is not correct: '%T'", tag, p) + slog.Debug("i18n could not load printer from map with incorrect type", "tag", tag, "type", fmt.Sprintf("%T", p)) return message.NewPrinter(tag) } return p @@ -165,7 +165,7 @@ func WrapInternalf(err error, disp string, args ...any) *Error { // initializeLangs initializes the printers from the default catalog into the sync map // we cannot do this in init() because this is too early func inititializeLangs() { - log.Logger.Debugf("i18n: initializing languages...") + slog.Debug("i18n initializing languages") for _, t := range message.DefaultCatalog.Languages() { printers.Store(t, message.NewPrinter(t)) } -- cgit v1.2.3