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 NewDebugLogger() (logger, error)
- func NewHandlerInFolder(path string) (h handler, err error)
- func NewLogger(handler slog.Handler) (logger, error)
- func Notice(msg string, args ...any) bool
- func Trace(msg string, args ...any) bool
- func Warning(msg string, args ...any) bool
- type ErrorLogger
- type Logger
- 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 NewDebugLogger ¶ added in v0.6.8
func NewDebugLogger() (logger, error)
func NewHandlerInFolder ¶
Types ¶
type ErrorLogger ¶ added in v0.8.0
type ErrorLogger 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) ErrorLogger
func WithErrorFunc ¶ added in v0.8.0
func WithErrorFunc(errf func() error) ErrorLogger
type Logger ¶
type Logger interface {
ErrorLogger
WithError(err error) ErrorLogger
WithErrorFunc(errf func() error) ErrorLogger
WithoutEscalation() Logger
SetDefault()
}
func WithoutEscalation ¶ added in v0.7.2
func WithoutEscalation() Logger
type RedactedString ¶ added in v0.6.7
type RedactedString string
func (RedactedString) LogValue ¶ added in v0.6.7
func (RedactedString) LogValue() slog.Value
func (RedactedString) String ¶ added in v0.6.7
func (r RedactedString) String() string
Click to show internal directories.
Click to hide internal directories.