Versions in this module Expand all Collapse all v1 v1.0.1 Jun 30, 2026 v1.0.0 Jun 30, 2026 Changes in this version + const LocaleEnUS + const LocaleEsES + const LocaleFrFR + var ErrInvalidLevel = errors.New("logger: invalid log level") + var I18n = i18n.NewPackageTranslatorWithFS("logger", localeFS, "locales", i18n.WithDefaults(defaults)) + func Debug(msg string, args ...any) + func DetectLocale() string + func Error(msg string, args ...any) + func Fatal(msg string, args ...any) + func GetSupportedLocales() []string + func Info(msg string, args ...any) + func ResetUnpairedWithFieldsCount() + func SetLogger(log Logger) + func SetTranslator(translator TranslatorProvider) + func UnpairedWithFieldsCount() uint64 + func Warn(msg string, args ...any) + type GenderCategory = i18n.GenderCategory + const Feminine + const GenderOther + const Masculine + const Neuter + type Level int + const LevelDebug + const LevelError + const LevelFatal + const LevelInfo + const LevelWarn + func ParseLevel(s string) (Level, error) + func (l Level) String() string + type LeveledLogger interface + Debug func(msg string, args ...any) + Error func(msg string, args ...any) + Fatal func(msg string, args ...any) + Info func(msg string, args ...any) + Warn func(msg string, args ...any) + type Logger interface + Enabled func(level Level) bool + WithContext func(ctx context.Context) Logger + WithFields func(fields ...any) Logger + WithLevel func(level Level) Logger + func GetLogger() Logger + func Log() Logger + func WithContext(ctx context.Context) Logger + func WithField(key string, value any) Logger + func WithFields(fields ...any) Logger + type NopLogger struct + func (NopLogger) Debug(string, ...any) + func (NopLogger) Enabled(Level) bool + func (NopLogger) Error(string, ...any) + func (NopLogger) Fatal(string, ...any) + func (NopLogger) Info(string, ...any) + func (NopLogger) Warn(string, ...any) + func (n NopLogger) WithContext(context.Context) Logger + func (n NopLogger) WithFields(...any) Logger + func (n NopLogger) WithLevel(Level) Logger + type TranslatorProvider interface + GetLocale func() string + HasKey func(key string) bool + SetLocale func(locale string) + Translate func(key string) string + TranslateGender func(key string, gender GenderCategory) string + TranslatePlural func(key string, count interface{}) string + TranslateWithArgs func(key string, args ...interface{}) string + func GetTranslator() TranslatorProvider + func NewTranslator(locale string) (TranslatorProvider, error)