Open mmlb opened 2 months ago
I think I like go-logr/logr's api over log/slog but there's something to be said for being in the stdlib for log/slog. Both apis are pretty similar but I like that logr is explicitly Error and Info levels only and has V() to control which messages actually make it through. I also like that logr has an Error
method that takes in an error
.
slog has explicit methods for the different levels which is helpful if we use it (we do but only in a couple of files so not that big of a deal imo) but is in the stdlib which is a big +. I don't like that it doesn't have an Error method that requires an error argument though, we definitely use that a bunch. I don't really like the api for tweaking a slog.Logger though it only happens in main and examples.
Opening this up here to have a single place for discussion regarding this. I've opened #138 and #139 with two implementations. #138 keeps logrus around (for now) and #139 just switches over to stdlib's log/slog library. @joelrebel @splaspood @turegano-equinix thoughts?