Documentation
¶
Index ¶
- type Bound
- func (sgh Bound) A(name string, value any) Bound
- func (sgh Bound) Attr(attrs ...slog.Attr) Bound
- func (sgh Bound) Context(ctx context.Context) context.Context
- func (sgh Bound) Debug(msg string)
- func (sgh Bound) Error(err error, msg string)
- func (sgh Bound) Handler() slog.Handler
- func (sgh Bound) Info(msg string)
- func (sgh Bound) Log(level slog.Level, msg string)
- func (sgh Bound) LogFromWrapper(additionalWrapDepth int, level slog.Level, msg string)
- func (sgh Bound) MustNotError(err error)
- func (sgh Bound) NoSource() Bound
- func (sgh Bound) Warn(msg string)
- func (sgh Bound) Wrap() Bound
- type L
- func (l L) A(name string, value any) L
- func (l L) Attr(attr slog.Attr) L
- func (l L) Context(ctx context.Context) context.Context
- func (l L) Debug(ctx context.Context, msg string)
- func (l L) Err(err error) L
- func (l L) Error(ctx context.Context, msg string)
- func (l L) Handler(ctx context.Context) slog.Handler
- func (l L) Info(ctx context.Context, msg string)
- func (l L) Log(ctx context.Context, level slog.Level, msg string)
- func (l L) LogFromWrapper(ctx context.Context, additionalWrapDepth int, level slog.Level, msg string)
- func (l L) NoSource() L
- func (l L) Warn(ctx context.Context, msg string)
- func (l L) Wrap() L
- type Sugar
- func (sgh Sugar) A(name string, value any) Sugar
- func (sgh Sugar) Attr(attrs ...slog.Attr) Sugar
- func (sgh Sugar) Bound(ctx context.Context) Bound
- func (sgh Sugar) Context(ctx context.Context) context.Context
- func (sgh Sugar) Debug(ctx context.Context, msg string)
- func (sgh Sugar) Error(ctx context.Context, err error, msg string)
- func (sgh Sugar) Handler(ctx context.Context) slog.Handler
- func (sgh Sugar) Info(ctx context.Context, msg string)
- func (sgh Sugar) Log(ctx context.Context, level slog.Level, msg string)
- func (sgh Sugar) LogFromWrapper(ctx context.Context, additionalWrapDepth int, level slog.Level, msg string)
- func (sgh Sugar) MustNotError(ctx context.Context, err error)
- func (sgh Sugar) NoSource() Sugar
- func (sgh Sugar) Warn(ctx context.Context, msg string)
- func (sgh Sugar) Wrap() Sugar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bound ¶
type Bound struct {
// contains filtered or unexported fields
}
Like Sugar, but it retains a handler instance instead and its logging methods do not take a Context
func (Bound) LogFromWrapper ¶
handles a new log record, this provides all the functionality, able to be used in wrapping log calls
func (Bound) MustNotError ¶
logs and panics if err is not nil
type L ¶
type L struct {
// contains filtered or unexported fields
}
Sugar handle
func (L) LogFromWrapper ¶
func (l L) LogFromWrapper(ctx context.Context, additionalWrapDepth int, level slog.Level, msg string)
handles a new log record
type Sugar ¶
type Sugar struct {
// contains filtered or unexported fields
}
Base sugar handle
func New ¶
func New() Sugar
Function that returns a sugar handle and ensures that default init was done
func (Sugar) LogFromWrapper ¶
func (sgh Sugar) LogFromWrapper(ctx context.Context, additionalWrapDepth int, level slog.Level, msg string)
handles a new log record, this provides all the functionality, able to be used in wrapping log calls
func (Sugar) MustNotError ¶
logs and panics if err is not nil
Click to show internal directories.
Click to hide internal directories.