/slog-fingerscrossed

Golang slog handler with fingers-crossed strategy

Primary LanguageGoMIT LicenseMIT

slog-fingerscrossed 🤞

godoc

Golang slog.Handler with fingers-crossed strategy.

Inspired by PHP Monolog.

What is the fingers-crossed strategy?

It takes your logs no matter their level and buffers them.

It then flushes them only if an error is logged.

This allows logging debug information when an error happens, while not polluting your logs when everything works fine.

See the example for more information.