Closed arahayrabedian closed 2 years ago
Is there a reason this wasn't merged? Can I help at all?
Note that using logging.warning
instead of logging.getLogger().warning
is even worse than just using the root logger. It also attaches a StreamHandler to the root logger, and this behavior cannot be changed. This is extremely annoying and conflicts with logger handling in pretty much any application that makes non-trivial use of logging.
I think/suspect general inactivity on fuzzywuzzy
. I'm still all ears to any changes that need to be made.
Please merge this pull request; it's a very simple change, but I'm learning more complicated logging patterns for the first time, and I was tearing my hair out for a really long time trying to figure out why I was getting duplicate log output and it was because of this.
This change is best practice, take it straight from the python documentation:
@josegonzalez could you take a look and merge this one?
Yeah seems legit. I'll merge on Monday, I need to get access to PyPi again now that I've come back :)
Why was this closed? It would be great if we could have this 1-line change merged!
Ping @josegonzalez in case it slipped through the cracks.
i closed it only cos i saw fuzzywuzzy's apparently been moved to thefuzz
(see readme) and I no longer expect this to be merged here.
recently started using github more extensively again and didn't want to keep seeing this in the list of my open pull requests (which i use as a part of my workflow)
Allows inheriting projects to conveniently control the log level of
fuzzywuzzy
's logging by attaching to it's own package-spaced logger rather than the root logger - for example our project wants to set fuzzywuzzy's logging level toERROR
without setting the entire root logger toERROR
.Evidence that this works:
before the changes (your master):
after the changes:
this means that I can now do:
logging.getLogger("fuzzywuzzy").setLevel("ERROR")
in my own application (or any other way of configuring a level) and expect it not to spew out thatlogger.warning
line in to my logs.to my knowledge this shouldn't affect the
warnings.warn
by default