Documentation
¶
Overview ¶
Package powerslog provides a slog.Handler implementation designed for use with AWS Lambda functions and captures key fields from the Lambda context, it is intended to be functionally similar to the Powertools loggers for Python and TypeScript whilst remaining idiomatic for the Go programming language.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a slog.Handler that writes Records that include key fields from an AWS Lambda context to an io.Writer.
func NewHandler ¶
NewHandler creates a Handler that writes to w, using the given options. It adds the service name and function name to the attributes of the log record during handler construction since these values are not going to change during the lifetime of the handler.
func (*Handler) Enabled ¶
Enabled reports whether the handler handles records at the given level. The handler ignores records whose level is lower.
func (*Handler) Handle ¶
Handle implements the slog.Handler interface and handles the Record. It will only be called when Enabled returns true.