Documentation
¶
Index ¶
- func FromContext(ctx context.Context) *slog.Logger
- func NewContext(ctx context.Context, v slog.Logger) context.Context
- func SetupContext(ctx context.Context, defaultWriter io.Writer) context.Context
- func WithCommand(ctx context.Context, command string) *slog.Logger
- func WithCommandContext(ctx context.Context, command string) context.Context
- type Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext returns the logger from context, or new logger if not present in context
func NewContext ¶
NewContext returns a new context with logger.
func SetupContext ¶
SetupContext creates supplies a context.Context with new Logger instance It handles setting up logging level and log output
func WithCommand ¶
WithCommand returns a Logger supplied with given 'command' field
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a custom slog handler
func NewHandler ¶
NewHandler returns configured SlogHandler
Click to show internal directories.
Click to hide internal directories.