slogx

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigKey       = "config"
	ErrorKey        = "error"
	HealthStatusKey = "health_status"
	PanicKey        = "panic"
	StacktraceKey   = "stacktrace"
	TraceIDKey      = "trace_id"
	SpanIDKey       = "span_id"
	SampledKey      = "sampled"
	SubjectKey      = "subject"
	RPCSystemKey    = "rpc_system"
	RPCServiceKey   = "rpc_service"
	RPCMethodKey    = "rpc_method"
)

Variables

This section is empty.

Functions

func Config added in v0.0.94

func Config(conf any) slog.Attr

...

TODO: document how to redact secrets.

func Err

func Err(err error) slog.Attr

...

func FromContext added in v0.0.90

func FromContext(ctx context.Context) *slog.Logger

FromContext returns the logger from the context, or the default logger if none exists.

func HealthStatus

func HealthStatus(status fmt.Stringer) slog.Attr

...

func IntoContext added in v0.0.114

func IntoContext(ctx context.Context, logger *slog.Logger) context.Context

IntoContext adds the given logger to the context, returning the new context.

func Panic

func Panic(val any) slog.Attr

...

func RPCMethod

func RPCMethod(method string) slog.Attr

...

func RPCService

func RPCService(service string) slog.Attr

...

func RPCSystem added in v0.0.90

func RPCSystem(system string) slog.Attr

...

func Sampled added in v0.0.123

func Sampled(span trace.Span) slog.Attr

...

func SpanID added in v0.0.123

func SpanID(span trace.Span) slog.Attr

...

func Stacktrace

func Stacktrace() slog.Attr

...

func Subject added in v0.1.93

func Subject(subject string) slog.Attr

...

func TraceID

func TraceID(span trace.Span) slog.Attr

...

Types

This section is empty.

Jump to

Keyboard shortcuts

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