Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zerolog with two ouputs: create to logging objects or just switch the Output value everytime? #616

Open
muhammadthayyil opened this issue Nov 7, 2023 · 2 comments

Comments

@muhammadthayyil
Copy link

Im doing a project that uses zerologging library for its logging support

currently im logging to console, but i was hoping to split the output stream into debugging/infos to stdOut and warns/errors to stdErr.

would it be better to create two separate logging objects, one outputting to stdOut and the other outputting to stdErr?
or should i just set the Output value of the logger each time there is a switch in the logging level (debug/info -> warn/error and vice versa) which would be happen a lot of times in the project

@v613
Copy link

v613 commented Dec 18, 2023

Maybe you should try implement zerolog.ConsoleWriter

Also take a look at #150

@v613
Copy link

v613 commented Dec 22, 2023

@muhammadthayyil if I understood you correctly, here is an example:
#363 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants