GEOPY-2420: change get_logger function to define setLevel#151
GEOPY-2420: change get_logger function to define setLevel#151MatthieuCMira wants to merge 5 commits intodevelopfrom
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.
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.
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.
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.
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.