Slog handler that checks context to set log level

83 views
Skip to first unread message

michel....@gmail.com

unread,
Sep 9, 2024, 5:49:04 AMSep 9
to golang-nuts
Hello,

I've written a slog handler that checks the context for a key/value and changes the log level to debugging if the value matches. It can be found at https://github.com/MichelHollands/tracerbullet.

Is this a valid use of a custom handler? Can you seen anything obviously wrong with this approach?

Thanks in advance,

Michel
Reply all
Reply to author
Forward
0 new messages