-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
CT-2022: Fix --quiet and DBT_ENABLE_LEGACY_LOGGER during initialization #7048
Conversation
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
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.
Can we add a test to prevent these regressions?
@aranke I'm glad you prodded me to write a test, because once I started on that I realized that I could not reproduce the original issue on main, and that in fact we do not (as far as I could see after searching for 10-15 minutes) have any code paths which would potentially fire non-error events before the call to setup_event_logger() in requires.py. I'm curious whether you think it's worth merging the code under review at all. It would protect us from regressions to the desired behavior if anyone were to ever fire events before log initialization in the future, but that's the only advantage I can imagine. In the meantime it's hard to create a test which would fail without the fix under review. |
@peterallenwebb The original regression report in #6749 was for the Repro case:
FWIW, this seems to "just work" on the
I'm not sure exactly how, but: I was under the impression that |
@jtcohen6 I was under the same impression you were. What's happening is that So, we don't need to do anything to resolve the original issue on main. The only question is whether it is worth it to keep this fix in place, just in case someone adds non-error events to the Flag generation code, or any other code which they might execute between command line parsing and log configuration. I am leaning toward no at the moment, since it adds complexity, but happy to let you make the call. |
Thanks for digging in to confirm!
I agree with "no." In the medium term, we should stop reading I called out in #6207 (comment) that we shouldn't do any more-complex logging while initializing configs:
Basically: Logging is not allowed until we have an initialized app, including a fully initialized & configured logger. That codepath should be incredibly clear, and if anything goes wrong during that initialization, it's a show-stopping error. |
Closing based on the consensus that this is already fixed on main, and no further work is warranted. |
resolves #6847
Description
Checks the values of --quiet and --enable-legacy-logger after the cli and env parameters are parsed, but before the user profile is parsed. This way, the value of those parameters can be respected even for events which are fired during profile parsing.
Checklist
changie new
to create a changelog entry