{"repo":"samber/slog-formatter","free":true,"listed":false,"github":"https://github.com/samber/slog-formatter","clone":"git clone https://github.com/samber/slog-formatter.git","description":"🚨 slog: Attribute formatting","language":"Go","stars":225,"topics":["anonymization","error","formatter","formatting","go","golang","handler","log-level","logger","logging"],"license":"MIT","category":"dev-tools","readme_excerpt":"slog: Attribute formatting Common formatters for slog library + helpers for building your own. Sponsored by: Cut Kubernetes & AI costs, boost application stability 100% OpenTelemetry-native observability platform Simple to use, built on open standards, and designed for full cost control Handlers: - NewFormatterHandler: main handler - NewFormatterMiddleware: compatible with slog-multi middlewares - RecoverHandlerError: catch panics and error from handlers Common formatters: - TimeFormatter: transforms a time.Time into a readable string - UnixTimestampFormatter: transforms a time.Time into a unix timestamp. - TimezoneConverter: set a time.Time to a different timezone - ErrorFormatter: transforms a go error into a readable error - HTTPRequestFormatter: transforms a http.Request into a readable object - HTTPResponseFormatter: transforms a http.Response into a readable object - PIIFormatter: hide private Personal Identifiable Information (PII) - IPAddressFormatter: hide ip address from logs - FlattenFormatterMiddleware: returns a formatter middleware that flatten attributes recursively Custom formatter: - Format: pass any attribute into a formatter - FormatByKind: pass attributes matching slog.Kind into a formatter - FormatByType: pass attributes matching generic type into a formatter - FormatByKey: pass attributes matching key into a formatter - FormatByFieldType: pass attributes matching both key and generic type into a formatter - FormatByGroup: pass attributes under a group in","default_branch":null,"files":null,"tree":[],"storefront":"/r/samber","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/samber/slog-formatter/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}