logging

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package logging configures structured logging and masks personal data in log attributes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextHandler

func ContextHandler(h slog.Handler) slog.Handler

ContextHandler wraps h so each record logged with a context carries the attributes added to it with WithAttrs, and the Lambda request ID (request_id) when the context is a Lambda invocation context.

func MaskEmail

func MaskEmail(addr string) string

MaskEmail hides all but the first character of the local part, for example "u***@example.com".

func NewJSONHandler

func NewJSONHandler(w io.Writer, level slog.Leveler) slog.Handler

NewJSONHandler returns a JSON handler wrapped with ContextHandler.

func WithAttrs

func WithAttrs(ctx context.Context, attrs ...slog.Attr) context.Context

WithAttrs returns a context whose log records carry attrs, in addition to any attributes already on ctx.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL