Hi,

When reading trough the log/slog documentation, it seems one can create a logger with a different handler, which is either NewTextHandler or NewJSONHandler.

Why can't I configure the defaultHandler? Let's say I want my logger to behave exactly like the defaultHandler, but output to a logfile or Stdout instead.

The defaultHandler's output is different compared to the NewTextHandler:

slog.Info("ok"), gives me:

INFO ok

The NextTextHandler gives me:

level=INFO msg="ok"


Regards,

--
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/be7c2e16-68b5-4d32-ae99-3b6786b32fa0%40mailbox.org.

Reply via email to