Documentation
¶
Index ¶
- Constants
- func ReduceFunctionName(function string) string
- type Buffer
- type Handler
- func (this *Handler) Enabled(_ context.Context, level slog.Level) bool
- func (this *Handler) Handle(_ context.Context, r slog.Record) error
- func (this *Handler) ReplaceAttr() func(groups []string, a slog.Attr) slog.Attr
- func (this *Handler) WithAttrs(attrs []slog.Attr) slog.Handler
- func (this *Handler) WithGroup(name string) slog.Handler
- type Logger
- func (this *Logger) AddSource()
- func (this *Logger) Clone() *Logger
- func (this *Logger) GetHandlerOptions() *slog.HandlerOptions
- func (this Logger) New() *Logger
- func (this *Logger) Printf(format string, v ...any)
- func (this *Logger) Reset()
- func (this *Logger) SetDefault()
- func (this *Logger) SetHandler(handlerFunc func(io.Writer, *slog.HandlerOptions) slog.Handler)
- func (this *Logger) SetLogLevel(level slog.Level)
- func (this *Logger) SetOutput(output io.Writer)
- func (this *Logger) Trace(msg string, args ...any)
- func (this *Logger) TraceContext(ctx context.Context, msg string, args ...any)
- func (this Logger) With(args ...any) *Logger
- func (this Logger) WithGroup(name string) *Logger
Constants ¶
View Source
const ( LevelTrace = slog.Level(-8) LevelDebug = slog.LevelDebug LevelInfo = slog.LevelInfo LevelWarn = slog.LevelWarn LevelError = slog.LevelError )
Variables ¶
This section is empty.
Functions ¶
func ReduceFunctionName ¶
Function used to reduce a Function name (from logging)
Types ¶
type Buffer ¶
type Buffer []byte
Buffer is a byte buffer.
This implementation is adapted from the unexported type buffer in go/src/fmt/print.go.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(w io.Writer, opts *slog.HandlerOptions) *Handler
func (*Handler) ReplaceAttr ¶
type Logger ¶
func (*Logger) GetHandlerOptions ¶
func (this *Logger) GetHandlerOptions() *slog.HandlerOptions
func (*Logger) SetDefault ¶
func (this *Logger) SetDefault()
func (*Logger) SetHandler ¶
func (*Logger) SetLogLevel ¶
func (*Logger) TraceContext ¶
Click to show internal directories.
Click to hide internal directories.