Repository navigation
Refactor logging - #3000
Merged
Merged
Refactor logging#3000
Conversation
ssbarnea
self-requested a review
November 29, 2020 10:48
ssbarnea
requested changes
Nov 29, 2020
Member
There was a problem hiding this comment.
I see a regression: "Found config file" which is printed before does no longer happen with this patch.
tadeboro
force-pushed
the
refactor-logging
branch
from
November 29, 2020 21:21
b565ebd to
f23bd81
Compare
tadeboro
marked this pull request as ready for review
November 29, 2020 21:29
ssbarnea
requested changes
Dec 3, 2020
Member
There was a problem hiding this comment.
Can you please fix the conflicts and ping me when this seams ready for review? (no known undesired side-effects). I will have to test it manually to assure we do not mess the logging even more with it but I need your confirmation first.
added 4 commits
December 3, 2020 13:24
When we removed custom logging handlers, we left behind a few helper classes that we are not using anymore. This commit finishes the job of removing custom bits from the codebase.
The main purpose of changes in current commit is to centralize the logger configuration. Previously, molecule configured each and every logger, creating new handler for each one, which made little sense. In the new implementation, we only configure the root molecule logger. All children logger instances inherit the configuration, making away with duplication. With our logging refactor, it also became feasible to use Python's built-in logging facilities as instructed in the official docs. Do note that we left the get_logger function in the logger module because that piece of code is used by various molecule plugins (for example, drivers) to obtain the properly configured logger instance. But we again made sure we just nest the logger below the molecule root logger and let it inherit the configuration.
Up until now, we ignored the verbosity setting and only used it to control the verbosity of the Ansible subprocess. This commit reuses the verbosity flag to also control the molecule verbosity.
tadeboro
force-pushed
the
refactor-logging
branch
from
December 3, 2020 12:26
f23bd81 to
c200b9e
Compare
Contributor
Author
|
I rebased the PR and tested it again locally. The only visible change of behavior from the master branch now should be the suppression of debug messages when running Molecule with no verbosity or debug flags. |
ssbarnea
approved these changes
Dec 3, 2020
This was referenced Mar 17, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Molecule reinvented the logging for some reason and did not use the standard Python logging facilities as they are meant to be used. This PR brings some sanity to the logging part of the code.
See commit messages for more detailed change descriptions.
PR Type
Fixes: #2999