Documentation ¶
Index ¶
- Constants
- func GetLogger(ctx context.Context) *slog.Logger
- func Logging(hOpts *HandlerOptions, mOpts *MiddlewareOptions) func(http.Handler) http.Handler
- func ParseLogLevel(value string) slog.Leveler
- func ReplaceLogLevel(_ []string, a slog.Attr) slog.Attr
- func WithLogger(ctx context.Context, logger *slog.Logger) context.Context
- func WithTrace(logger *slog.Logger, span trace.Span, googleProjectID string) *slog.Logger
- type Handler
- type HandlerOptions
- type MiddlewareOptions
- type Stack
Constants ¶
View Source
const ( DEBUG = slog.LevelDebug INFO = slog.LevelInfo NOTICE = slog.Level(2) WARNING = slog.LevelWarn ERROR = slog.LevelError CRITICAL = slog.Level(10) ALERT = slog.Level(12) EMERGENCY = slog.Level(14) )
The slog package provides four log levels by default, and each one is associated with an integer value: DEBUG (-4), INFO (0), WARN (4), and ERROR (8).
Variables ¶
This section is empty.
Functions ¶
func Logging ¶
func Logging( hOpts *HandlerOptions, mOpts *MiddlewareOptions, ) func(http.Handler) http.Handler
func ParseLogLevel ¶
func WithLogger ¶
WithLogger adds a *slog.Logger to the current context.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(opts *HandlerOptions) *Handler
type HandlerOptions ¶
type MiddlewareOptions ¶
Click to show internal directories.
Click to hide internal directories.