-
Notifications
You must be signed in to change notification settings - Fork 6
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
Logging Feature #72
base: master
Are you sure you want to change the base?
Logging Feature #72
Conversation
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.
some nits.
also, does your editor remove trailing whitespace on the end of files? it's not a huge deal, but typical styleguides say that files have trailing newlines. It's actually a Linux standard and a lot of command line utilities dont deal with files correctly if you dont have a trailing newline
src/data_collection/helpers.py
Outdated
from rest_framework.response import Response | ||
from .models import Data | ||
|
||
def logger(cls, data): |
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.
can you name this log
so the function is a verb and not a noun?
src/data_collection/helpers.py
Outdated
from .models import Data | ||
|
||
def logger(cls, data): | ||
new_data = Data(data_type=cls, log=data) |
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.
if the field name is data_type
, can you name this variable to be data_type
instead of cls
src/data_collection/models.py
Outdated
log = JSONField() | ||
|
||
def __str__(self): | ||
return '%s: %s' % (self.data_type, self.log) |
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.
you might want to include the time on the str
src/pickmybruin/settings.py
Outdated
@@ -189,4 +188,4 @@ | |||
REQUEST_TEMPLATE = '682f1eee-9441-4baf-aa1b-780281f25694' | |||
USER_VERIFICATION_TEMPLATE = 'ddd14008-25ee-46c6-9a55-b6b4d577a54b' | |||
MESSAGING_TEMPLATE = 'ea29ebe3-df27-4383-9234-0d01539980e3' | |||
PASSWORD_RESET_TEMPLATE = '262bdea5-7921-47b1-946d-7438ee7f865b' | |||
PASSWORD_RESET_TEMPLATE = '262bdea5-7921-47b1-946d-7438ee7f865b' |
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.
should this change be in this pull request?
Did the changes, let me know if there is anything else that needs to be looked at. I'll look into the trailing newlines as well |
src/data_collection/models.py
Outdated
return '%s: %s %s' % (self.data_type, self.log, datetime.now(pytz.timezone('US/Pacific'))) |
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 meant date_created
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.
Yeah I figured that out later.. Changed it
oh man this PR is alive again! |
Description
Added logging feature to track major search.
Pls do
Test plan