diff options
| author | Jeroen Wijenbergh <jeroen.wijenbergh@geant.org> | 2025-05-06 14:33:54 +0200 |
|---|---|---|
| committer | Jeroen Wijenbergh <jeroen.wijenbergh@geant.org> | 2025-05-06 15:40:55 +0200 |
| commit | 3f0c2643b4caadd3a47201caa2c6acba2585241d (patch) | |
| tree | cd6af32500156184d74d28c1476d18f33dbdee33 /i18nerr | |
| parent | 15bef1fca407c21eed5d2c433051042c728468e6 (diff) | |
All: Move to log/slog
Diffstat (limited to 'i18nerr')
| -rw-r--r-- | i18nerr/i18nerr.go | 8 |
1 files changed, 4 insertions, 4 deletions
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)) } |
