Open AlexanderMann opened 4 years ago
@AlexanderMann Thanks for raising this. I've chatted with the team and we do think this is unexpected behavior and could be a bug. The team would welcome a PR if the is something you want to take a crack at resolving.
@briansloane just realized I never pushed anything on this/etc. Do you know if there's been any work on this or if this would still be a welcomed pr?
Considering how many other repos use this package, I'd not dare to introduce a breaking change here, but would you be open to a PR that allows overriding the log level here via some env var that's unlikely to be used elsewhere, say SINGER_LOGLEVEL
for instance. If not set, nothing changes, but it allows users to opt-in to a cleaner behaviour.
Problem
Singer-Python
is the root repo for pretty much everytap
andtarget
, and the suggested way to log "out" is to usesinger.get_logger()
or one of the helpers oflog_info
, or...log_debug
.For
target-postgres
we use theDEBUG
level for logging in tests, and for gaining more information for issues/bug reports etc.To enable
DEBUG
logging, we have a single call out tosinger.get_logger()
followed up bysetLevel('DEBUG')
(loosely). This works pretty well up untilget_logger()
gets called again.Once
get_logger
gets called again, thefileConfig
code gets run again, and the root logger gets reset to thelogging.conf
and having the level set toINFO
.Once this happens,
log_debug
no longer works.Question
Is there a suggested way to use/get
DEBUG
output while also leveragingsinger-python
?...or...
Is this a 🐛?
Suggested Musical Pairing
https://soundcloud.com/winnetka-bowling-league/slow-dances