Remix.run Logo
arccy 2 days ago

The blessed interface for libraries is to accept a slog.Logger.

The blessed interface for logging backends is slog.Handler.

Applications can then wire that up with a handler they like, for example

zap: https://pkg.go.dev/go.uber.org/zap/exp/zapslog#Handler

charm https://github.com/charmbracelet/log?tab=readme-ov-file#slog...

trenchpilgrim 2 days ago | parent [-]

I used slog.Logger for an OSS project and I will not do it again. The interface is terrible, and far more verbose and less expressive than something like Zap or zerolog. e.g. there's not really anything as good as zerolog's log.Dict() for dealing with complex structures.