Documentation
¶
Index ¶
- Constants
- func ErrDebug(msg string, err error, additional ...slog.Attr)
- func ErrError(msg string, err error, additional ...slog.Attr)
- func ErrInfo(msg string, err error, additional ...slog.Attr)
- func ErrLog(level slog.Level, msg string, err error, additional ...slog.Attr)
- func ErrTrace(msg string, err error, additional ...slog.Attr)
- func ErrWarn(msg string, err error, additional ...slog.Attr)
- func NewDefaultLogger(loglevel string, format Format)
- func ReplaceLogLevel(groups []string, a slog.Attr) slog.Attr
- func ReplaceSource(groups []string, a slog.Attr) slog.Attr
- func SetDefaultErrorer(format Format)
- type Errorer
- type Format
- type Logger
- type StructuredError
Constants ¶
View Source
const ( LevelTrace = slog.Level(-8) LevelTraceName = "TRACE" )
View Source
const ( JSON = "json" TEXT = "text" )
View Source
const (
ERROR = "error"
)
Variables ¶
This section is empty.
Functions ¶
func NewDefaultLogger ¶
func SetDefaultErrorer ¶
func SetDefaultErrorer(format Format)
Types ¶
type Logger ¶
func DefaultLogger ¶
func DefaultLogger() *Logger
func NewLoggerFromDefault ¶
func NewLoggerFromDefault(options *slog.HandlerOptions, format Format) *Logger
type StructuredError ¶
func NewStructuredError ¶
func NewStructuredError(err error, attrs ...slog.Attr) StructuredError
func (StructuredError) Error ¶
func (serr StructuredError) Error() string
func (StructuredError) Unwrap ¶
func (serr StructuredError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.