-
Notifications
You must be signed in to change notification settings - Fork 105
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
logger creation removed from __init__.py #27
Conversation
As mentioned in #11, I think the logger should be created on import so that the user can do |
handout/tools.py
Outdated
|
||
def get_logger(): | ||
logger = logging.getLogger('handout') | ||
logger.setLevel(logging.INFO) # A user can change this level later. |
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.
Regarding your comment for user levels, the user can change it globally by running this line, for example:
logger.setLevel(logging.DEBUG)
Also we actually do not provide any other logging messages than info().
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.
Well, actually he wouldn't change the log level for that particular logger... need a rethink.
Here is an idea - one function is This way the logger is available upon import and configurable by the user, but we keep |
Added logger.py
This seems a bit too complicated to me. I don't think moving the logic from |
Well, you can make a one-liner change in Something happening in
It does - there is a dedicated file |
I can see some preference in keeping the codebase compact without |
User @epogrebnyak found the bug. Fixes #11. Closes #27.
You raise a valid point. I added the one line check and put a comment in the |
Dev comment is a good idea! |
Fixes #11