Documentation ¶
Index ¶
Constants ¶
View Source
const ( ProjectID = "project_id" RequestID = "request_id" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContextHandler ¶
type ContextHandler struct {
// contains filtered or unexported fields
}
ContextHandler is a logger handler that adds context attributes to log records.
func NewContextHandler ¶
func NewContextHandler(name string, baseHandler slog.Handler) *ContextHandler
NewContextHandler creates a new context handler.
func (*ContextHandler) Handle ¶
Handle warps the base handler's Handle method and adds context attributes to the log record.
Click to show internal directories.
Click to hide internal directories.