Documentation
¶
Overview ¶
Package log provides structured logging for gitcontribute using log/slog. Each package receives a pre-configured *slog.Logger at construction time. Logs are written to stderr; stdout is reserved for CLI program output.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates a structured logger for the given component name. The component name is attached to every log line as an attribute. In production (non-tty), output is JSON. In development (tty), a human-readable text handler is used.
func TraceFromContext ¶
TraceFromContext extracts a trace ID from the context for logging.
Types ¶
type RedactedString ¶
type RedactedString string
RedactedString wraps a potentially sensitive string so that it is redacted when logged. The LogValue method ensures only a safe prefix is emitted.
func (RedactedString) LogValue ¶
func (s RedactedString) LogValue() slog.Value
LogValue implements slog.LogValuer to emit a redacted representation.