Updated Resources for slog (markdown)

Samuel Berthe 2023-04-30 21:00:36 +02:00
parent f2079bdd42
commit e9e2d8789d

@ -5,22 +5,26 @@ instead, follow the `src/log/slog` directory of the [main Go repo](https://go.go
Since slog has been in flux for several months, some of these resources may be out of date and may not build. The API did not change that much, though, so fixes should be straightforward. Since slog has been in flux for several months, some of these resources may be out of date and may not build. The API did not change that much, though, so fixes should be straightforward.
#### Log formatting:
- slog-formatter: Common formatters for slog + helpers for building your own: https://github.com/samber/slog-formatter
- ConsoleHandler (similar to Zap's ConsoleEncoder): https://gist.github.com/wijayaerick/de3de10c47a79d5310968ba5ff101a19 - ConsoleHandler (similar to Zap's ConsoleEncoder): https://gist.github.com/wijayaerick/de3de10c47a79d5310968ba5ff101a19
- Zap Handler, a slog handler that uses Zap: https://github.com/chanchal1987/zaphandler
- logf (attr {key} interpolation, rich tty output): https://pkg.go.dev/github.com/AndrewHarrisSPU/logf (uses lazy Handler stores: https://go.dev/play/p/psdD7KDF5fp ) - logf (attr {key} interpolation, rich tty output): https://pkg.go.dev/github.com/AndrewHarrisSPU/logf (uses lazy Handler stores: https://go.dev/play/p/psdD7KDF5fp )
- Simple slog handler with opentelemetry tracing: https://github.com/ttys3/slogsimple/tree/main
- Experimental example using both OpenTelemetry and `slog`: https://github.com/justinsb/experiments-slog
- Additional resources written by jba: https://github.com/jba/slog
- slogd - slog with duration https://github.com/kaihendry/slogd with video https://youtu.be/IsPa11N5pzI - slogd - slog with duration https://github.com/kaihendry/slogd with video https://youtu.be/IsPa11N5pzI
- tinted (colorized) output: https://pkg.go.dev/github.com/lmittmann/tint - tinted (colorized) output: https://pkg.go.dev/github.com/lmittmann/tint
- humane: a human-friendly (but still largely structured) slog Handler: https://github.com/telemachus/humane - humane: a human-friendly (but still largely structured) slog Handler: https://github.com/telemachus/humane
- slug: a handler that prints colourful logs for humans: https://github.com/dotse/slug - slug: a handler that prints colourful logs for humans: https://github.com/dotse/slug
- various handlers: https://github.com/galecore/xslog
- slog-multi: chain of `slog.Handler` (pipeline, fanout, ...): https://github.com/samber/slog-multi #### Logger bridge:
- slog-formatter: Common formatters for slog + helpers for building your own: https://github.com/samber/slog-formatter - Zap Handler, a slog handler that uses Zap: https://github.com/chanchal1987/zaphandler
#### HTTP server middleware:
- slog-gin: Gin middleware for slog logger: https://github.com/samber/slog-gin - slog-gin: Gin middleware for slog logger: https://github.com/samber/slog-gin
- slog-echo: Echo middleware for slog logger: https://github.com/samber/slog-echo - slog-echo: Echo middleware for slog logger: https://github.com/samber/slog-echo
- slog-fiber: Fiber middleware for slog logger: https://github.com/samber/slog-fiber - slog-fiber: Fiber middleware for slog logger: https://github.com/samber/slog-fiber
#### Log sink:
- Experimental example using both OpenTelemetry and `slog`: https://github.com/justinsb/experiments-slog
- Simple slog handler with opentelemetry tracing: https://github.com/ttys3/slogsimple/tree/main
- slog-datadog: a `slog.Handler` for Datadog: https://github.com/samber/slog-datadog - slog-datadog: a `slog.Handler` for Datadog: https://github.com/samber/slog-datadog
- slog-rollbar: a `slog.Handler` for Rollbar: https://github.com/samber/slog-rollbar - slog-rollbar: a `slog.Handler` for Rollbar: https://github.com/samber/slog-rollbar
- slog-sentry: a `slog.Handler` for Sentry: https://github.com/samber/slog-sentry - slog-sentry: a `slog.Handler` for Sentry: https://github.com/samber/slog-sentry
@ -35,3 +39,8 @@ Since slog has been in flux for several months, some of these resources may be o
- slog-microsoft-teams: a `slog.Handler` for Microsoft Teams: https://github.com/samber/slog-microsoft-teams - slog-microsoft-teams: a `slog.Handler` for Microsoft Teams: https://github.com/samber/slog-microsoft-teams
- slog-webhook: a `slog.Handler` for Webhook: https://github.com/samber/slog-webhook - slog-webhook: a `slog.Handler` for Webhook: https://github.com/samber/slog-webhook
- slog-kafka: a `slog.Handler` for Kafka: https://github.com/samber/slog-kafka - slog-kafka: a `slog.Handler` for Kafka: https://github.com/samber/slog-kafka
#### Other:
- Additional resources written by jba: https://github.com/jba/slog
- slog-multi: chain of `slog.Handler` (pipeline, fanout, ...): https://github.com/samber/slog-multi
- various handlers: https://github.com/galecore/xslog