-
Notifications
You must be signed in to change notification settings - Fork 1
GEOPY-2420: change get_logger function to define setLevel #151
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
base: develop
Are you sure you want to change the base?
Conversation
Improve set logger tests.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #151 +/- ##
===========================================
- Coverage 84.91% 84.77% -0.15%
===========================================
Files 19 19
Lines 988 1018 +30
Branches 130 139 +9
===========================================
+ Hits 839 863 +24
- Misses 112 119 +7
+ Partials 37 36 -1
🚀 New features to boost your workflow:
|
| level_name: bool = True, | ||
| propagate: bool = True, | ||
| add_name: bool = True, | ||
| level: str | LoggerLevel | None = None, |
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.
Even wonder if we should not simplify and just expect a Literal[logging.WARNING, logging.INFO...]. It's not that much work on the other side to just import logging if you want to make specific cases.
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.
Because it's something we are using everywhere, we can have the luxury to create our loggers from a string in this function. That's for us.
It's not a lot of work, but quite convenient to just create a logger this way!
benk-mira
left a comment
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.
I think we should approve this as long as it meets our immediate needs. Ie: solves Matthieu's need for multiple levels of logging, fixes double printing in scigeoh5/plate-simulation, and doesn't interfere with existing logging behaviour. The we should open up an issue to explore Seb's idea, and propagate a unified logging system to all applications through the base driver.
sebhmg
left a comment
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.
Creating a separate logger for each level is not the recommended approach.
Please postpone these changes until we can devise a more robust solution, ideally leveraging Python’s built-in logging features.
GEOPY-2420 - change get_logger function to define setLevel
update get_logger to accept set_level as a string.
Improve set logger tests.