Skip to content
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

Setting app.debug does not propagate to app.log logger log level #386

Closed
kislyuk opened this issue Jun 25, 2017 · 0 comments · Fixed by #446
Closed

Setting app.debug does not propagate to app.log logger log level #386

kislyuk opened this issue Jun 25, 2017 · 0 comments · Fixed by #446
Labels

Comments

@kislyuk
Copy link
Contributor

kislyuk commented Jun 25, 2017

In https://github.com/awslabs/chalice/blob/master/chalice/app.py#L434-L437, intent is shown to set the logger's log level according to the value of Chalice.debug. However, app.debug is currently hardcoded to false in Chalice.__init__, so without calling Chalice. _configure_logging() again or setting it manually via app.log.setLevel(logging.DEBUG), it will always remain set to logging.ERROR.

It would probably make more sense to have a Chalice.debug setter that also sets the logger's level, and/or have a Chalice(debug=True) kwarg to make the code linked above behave as expected.

stealthycoin pushed a commit to stealthycoin/chalice that referenced this issue Jul 31, 2017
Debug mode can be set with `app.debug = True` which does not update
the logger level from ERROR to DEBUG. This is has been replaced with a
setter that reconfigures the log level after debug is reset. The
initialization method on the Chalice class had some logic that checked
what the debug value was and configured the logger to match; however,
debug was hardcoded to be False so this never did anything useful. A
debug parameter has been added to the the __init__ method to make this
more useful, it defaults to False.

fixes aws#386
stealthycoin pushed a commit to stealthycoin/chalice that referenced this issue Jul 31, 2017
Debug mode can be set with `app.debug = True` which does not update
the logger level from ERROR to DEBUG. This is has been replaced with a
setter that reconfigures the log level after debug is reset. The
initialization method on the Chalice class had some logic that checked
what the debug value was and configured the logger to match; however,
debug was hardcoded to be False so this never did anything useful. A
debug parameter has been added to the the __init__ method to make this
more useful, it defaults to False to be the same as the hardcoded value.

fixes aws#386
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants