-
Notifications
You must be signed in to change notification settings - Fork 88
Add centralized logger. #1031
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 centralized logger. #1031
Conversation
Suggesting the logging related to transaction to be set at DEBUG level datajoint-python/datajoint/connection.py Line 383 in 0ff34f2
datajoint-python/datajoint/connection.py Line 391 in 0ff34f2
datajoint-python/datajoint/connection.py Line 400 in 0ff34f2
|
Yes, this makes sense I will do that. @ttngu207 |
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.
@jverswijver Great work! 💪
Mostly ready just offering further improvements.
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.
@jverswijver Nice work! 🤝
datajoint/autopopulate.py
Outdated
@@ -288,6 +288,9 @@ def _populate1( | |||
exception=error.__class__.__name__, | |||
msg=": " + str(error) if str(error) else "", | |||
) | |||
logger.debug( | |||
f"Error making {key} -> {self.target.table_name} - {error_message}" |
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 think table_name
does not include the schema name whereas full_table_name
does.
f"Error making {key} -> {self.target.table_name} - {error_message}" | |
f"Error making {key} -> {self.target.full_table_name} - {error_message}" |
Adds a package level logger for the datajoint package.
Should accomplish the following:
- [ ] Evaluate log DB table to see if logging needs to be addedAdditional functionality requested by data science team:
- [ ] log warnings when user calls populate on emptykey_source
- [ ] debug level logging for any insert/deleteExample for capturing the log output but maintaining dj logging
See the converted test
test_limit_warning
in the PR.Basically you add a handler to the logger that sends all logs to a StringIO object and then retrieve the string from the object, then you remove the handler.