Open pwwang opened 10 months ago
Hm, interesting idea. Just to make sure I understand this: you are looking for a wrapper function that uses sink
or similar to capture either/both stdout
/stderr
and log with provided log level?
Not sure how to avoid the infinite recursion when logging to the console, but otherwise should be doable.
Yes, that's what I wanted.
Just a naive thought about the recursion: how about using a sentinel variable?
Or we could check if the inner message follows the logging format?
Thanks for the feature request! As I am busy with other things, I don't think I have the time to work in this in the coming months, so I would highly appreciate if someone can come up with a PR -- so thus I'm now setting the related "Help wanted" label.