[go-nuts] Using msotly plain slog, but changing the log.Logger underneath?

76 views
Skip to first unread message

Tobias Klausmann

unread,
Aug 12, 2023, 6:56:01 AM8/12/23
to golan...@googlegroups.com
Hi!

So I have been looking at golang v1.21, and while I like the slog
package in principle, it really annoys me that there is no way to get a
new slog Logger *that I can specify the underlying log.Logger for*.

It seems I have to implement a complete slog.Handler myself, which is
six miles of code I don't really want to do anything different (than the
default slog.Logger), except using a newly-created log.Logger (with a
different flag bitset). Am I missing something?

Best,
Tobias
Reply all
Reply to author
Forward
0 new messages