dusted-go / logging

Logging integrations for Go's log/slog package.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Define write destination

jsumners-nr opened this issue · comments

This handler is just what I was looking for except for one issue: we can't provide the destination writer. It'd be helpful if the following existed:

func New(writer io.Writer, options slog.HandlerOptions) {}

Use case:

I want to use this library for verbose logging to stderr while my application writes final rendered output to stdout.

That's a good suggestion and I like it. I am currently in an incredibly busy period so wouldn't be able to tackle this in the next few weeks myself, but I'd happily accept a PR if you wanted to help with this feature? Alternatively if you're happy to wait I'll try to implement this in May. The reason is that my wife and I are imminently expecting our second child and the next 4 weeks will be crazy busy, not just normal busy :)

🎉 congratulations!

If I'm able to get to it before you, I'll submit a PR. Technically, I'm not clear if I can create such a PR from this account and may need to try and remember to do it on personal time.