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

Add logging infrastructure #27

Merged
merged 8 commits into from
Apr 1, 2016
Merged

Conversation

jpalazz2
Copy link
Member

#25

@jpalazz2 jpalazz2 self-assigned this Mar 31, 2016
@jpalazz2 jpalazz2 added this to the Alpha milestone Mar 31, 2016
@@ -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
Copy link
Member

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))
Copy link
Member

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.

@hallfox
Copy link
Member

hallfox commented Apr 1, 2016

I approve, waiting if @alanplotko has anything to say

@alanplotko
Copy link
Member

Looks good on my end.

@jpalazz2 jpalazz2 merged commit a508f75 into BinghamtonCoRE:develop Apr 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants