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
Don't turn off stdout/stderr logging longer than necessary (RhBug:1843280) #1635
Conversation
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
☔ The latest upstream changes (presumably 2f1ad36) made this pull request unmergeable. Please resolve the merge conflicts. |
846f3db
to
5e1aba3
Compare
I brought back the I also wandered if it couldn't be resolved more elegantly, but I didn't find any other way to disable individual handlers (just the whole logger) and emitting a record straight into the one handler seems too hacky (though it would just mean creating a |
@@ -209,10 +201,6 @@ def _setup(self, verbose_level, error_level, logfile_level, logdir, log_size, lo | |||
logger_rpm.addHandler(self.stdout_handler) | |||
logger_rpm.addHandler(self.stderr_handler) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just paint both log file marks at this point, I don't think it matters much that they will happen a bit later. Then you don't need to forward the levels to _setup_file_loggers()
and you can also turn them off at this place once, paint both marks and turn them back on.
I would also set the level to WARNING
, not SUPERCRITICAL
, so that any errors won't actually be filtered out, but the paint mark at INFO
will.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea! I modified the PR according to your suggestions.
…3280) When _setup failed (for example due to missing permissions to create the log file), the error was not printed to stderr because of turning off the sdtout/stderr handlers temporarily. However, the stdout/stderr handlers need to be turned off only when creating the logging marker. https://bugzilla.redhat.com/show_bug.cgi?id=1843280
Looks a bit better now 🙂 @m-blaha I hope you don't mind me merging this... |
📌 Commit 41035e8 has been approved by |
☀️ Test successful - status-papr |
When _setup failed (for example due to missing permissions to create the
log file), the error was not printed to stderr because of turning off
the sdtout/stderr handlers temporarily.
However, the stdout/stderr handlers need to be turned off only when
creating the logging marker.
https://bugzilla.redhat.com/show_bug.cgi?id=1843280