-
Notifications
You must be signed in to change notification settings - Fork 7
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
adding logging to io.genomio.fasta.process #206
Conversation
from ensembl.utils.argparse import ArgumentParser | ||
|
||
# logging references module, but can be overridden by a specific logger | ||
import logging | ||
logger = logging # by default |
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.
Or we can just replace logger
with logging
and do something like
logging = None
import logging
def ...
logging.info(...)
def main:
...
logging = setup_logging(...)
...
Or make a more cruel thing.
Just treat import logging
as definition of a global var. So just
# logging = None
import logging
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 was not happy with the logger
approach either, so that is why I have opted for accessing the logging.root
instead in my PR.
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 like the reassigning of logging
way,
because in this case you're allowing the module to be used/imported from the outside without calling main function and setup we have in it.
So if you use main -- you define your own logger (however prettified) and assign it to global logging
(replacing it, basically).
But if you import this module from outside, you preserve logging default settings (perhaps, already modified by the calling/upstream code).
In this case this module itself doesn't import other models with logging.
I think, it's worth to update the root logger to propagate changes downstream, instead as in your PR !207.
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.
We have the new logging handler in ensembl-py now, this PR needs to use that one instead
replaced with #222 |
No description provided.