-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add logging infrastructure #27
Conversation
@@ -8,29 +9,39 @@ class BaseConfig(object): | |||
DEBUG = False | |||
TESTING = False | |||
MONGODB_SETTINGS = {'db': 'bikeshare'} | |||
LOGGING_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' | |||
LOGGING_LOCATION = 'bikeshare.log' | |||
LOGGING_LEVEL = logging.INFO | |||
|
|||
class TestingConfig(BaseConfig): | |||
"""Configuration for running unit tests""" | |||
DEBUG = False |
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.
There's no need to have this line since DEBUG is False in super()
"""This endpoint is for requesting a bike""" | ||
app.logger.debug('User %s requesting bike %d' % (user_email, bike_id)) |
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.
%-formatting is "old style formatting." The Python community is still trying to oust this in favor of the .format() method, eg 'User {} requesting bike {}'.format(user_email, bike_id). The {} is where the parameters will fall into and you can do lots of things with it, in fact the CFG that describes this new format string can be found here.
I approve, waiting if @alanplotko has anything to say |
Looks good on my end. |
#25