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

Add quiet option for disabling logging to stderr #137

Closed
ammannbe opened this issue Oct 11, 2023 · 4 comments
Closed

Add quiet option for disabling logging to stderr #137

ammannbe opened this issue Oct 11, 2023 · 4 comments
Labels
enhancement New feature or request fixed-in-master Fixed in master
Milestone

Comments

@ammannbe
Copy link

Other linux commands do provide a --quiet option or separate stdout and stderr.
For example I backup my virtual machine disks every day through cronjob and send an email with the result.
But if possible I don't want to send all the output generated, but only errors.

Is that possible? Thanks!

@ammannbe ammannbe added the enhancement New feature or request label Oct 11, 2023
@abbbi
Copy link
Owner

abbbi commented Oct 11, 2023

Hi, thanks for the Feedback! Yes, i think that option would be possible by removing the logging module stderr handler if its passed ..

As alternative you can reditect via

virtnbdbackup … 2>/dev/null

@abbbi abbbi changed the title Add quiet option or allow to redirect normal to /dev/null Add quiet option for disabling logging to stderr Oct 11, 2023
@abbbi
Copy link
Owner

abbbi commented Oct 11, 2023

just pushed changes with new option to master, likes or sponsoring welcome if you like the project
thanks

@abbbi abbbi closed this as completed Oct 11, 2023
@abbbi abbbi added this to the v1.9.43 milestone Oct 11, 2023
@abbbi abbbi added the fixed-in-master Fixed in master label Oct 11, 2023
@ammannbe
Copy link
Author

ammannbe commented Dec 3, 2023

Thank you very much for the implementation and sorry for the late reply!
I just tested the changes: is it also possible to disable only the stdout (but keep stderr) output?

@abbbi
Copy link
Owner

abbbi commented Dec 4, 2023

is it also possible to disable only the stdout (but keep stderr) output?

no plans to do so currently. If exit code != 0 then something went wrong; its possible to check the logs then. Otherwise --strict can be used, so warnings will change exit code aswell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed-in-master Fixed in master
Projects
None yet
Development

No branches or pull requests

2 participants