Fix: New log formats not being displayed #241
Merged
+11
−8
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.
As I was testing the image on my local cluster, i noticed that the formatting I've setup in my previous PR hasn't taken effect.
This is because when we ask for a new logger, it doesn't come with any handlers.
The solution to this is to use
logging.basicConfig
upon package instantiation.I know that we previously discussed this, but I said it was a problem if we put it in
__main__.py
as it'll only be available when the server is launched, and not if it's used as a package. And I don't know why I didn't think about putting it in the package's__init__.py
.@supakeen I know i've kep the
get_logger
method even though it does practically nothing.I just wanted to reduce the changes and also let room for extra setup if we're ever going to do that.
Also, what do you think about making the log level configurable ?