Documentation
¶
Index ¶
- Constants
- func Debug(msg string, args ...any) bool
- func Error(msg string, args ...any) bool
- func Fatal(msg string, args ...any)
- func Info(msg string, args ...any) bool
- func LevelToString(level slog.Level) string
- func NewDebugLogger() (logger, error)
- func NewHandlerInFolder(path string) (h fileHandler, err error)
- func NewLogger(handler slog.Handler) (logger, error)
- func Notice(msg string, args ...any) bool
- func ReplaceAttr(groups []string, a slog.Attr) slog.Attr
- func Trace(msg string, args ...any) bool
- func Warning(msg string, args ...any) bool
- type BaseLogger
- type DefaultLogger
- type ErrorLogger
- type RedactedString
Constants ¶
View Source
const ( LevelTrace = slog.Level(-8) LevelDebug = slog.LevelDebug LevelInfo = slog.LevelInfo LevelNotice = slog.Level(2) LevelWarning = slog.LevelWarn LevelError = slog.LevelError LevelFatal = slog.Level(12) )
Variables ¶
This section is empty.
Functions ¶
func LevelToString ¶ added in v0.7.5
func NewDebugLogger ¶
func NewDebugLogger() (logger, error)
func NewHandlerInFolder ¶
Types ¶
type BaseLogger ¶ added in v0.7.5
type BaseLogger interface { Trace(msg string, args ...any) bool Debug(msg string, args ...any) bool Info(msg string, args ...any) bool Notice(msg string, args ...any) bool Warning(msg string, args ...any) bool Error(msg string, args ...any) bool Fatal(msg string, args ...any) }
func WithError ¶
func WithError(err error) BaseLogger
func WithErrorFunc ¶
func WithErrorFunc(errf func() error) BaseLogger
type DefaultLogger ¶
type DefaultLogger interface { BaseLogger WithError(err error) BaseLogger WithErrorFunc(errf func() error) BaseLogger WithoutEscalation() ErrorLogger WithLocalScope(defaultLevel slog.Level) ErrorLogger }
func GetDefaultLogger ¶ added in v0.7.5
func GetDefaultLogger() DefaultLogger
type ErrorLogger ¶
type ErrorLogger interface { BaseLogger WithError(err error) BaseLogger WithErrorFunc(errf func() error) BaseLogger WithoutEscalation() ErrorLogger SetDefault() }
func WithLocalScope ¶ added in v0.7.5
func WithLocalScope(defaultLevel slog.Level) ErrorLogger
func WithoutEscalation ¶
func WithoutEscalation() ErrorLogger
type RedactedString ¶
type RedactedString string
func (RedactedString) LogValue ¶
func (RedactedString) LogValue() slog.Value
func (RedactedString) String ¶
func (r RedactedString) String() string
Click to show internal directories.
Click to hide internal directories.