-
Notifications
You must be signed in to change notification settings - Fork 92
[DRAFT] add more logging for populate()
#1029
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
Conversation
populate()populate()
datajoint/autopopulate.py
Outdated
| jobs.complete(self.target.table_name, self._job_key(key)) | ||
| else: | ||
| logger.info("Populating: " + str(key)) | ||
| logger.info("Start populating TABLE: {} - KEY: {}".format(self.target.table_name, key)) |
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.
| logger.info("Start populating TABLE: {} - KEY: {}".format(self.target.table_name, key)) | |
| logger.info(f"Making {self.target.table_name}: {key}") |
datajoint/autopopulate.py
Outdated
| exception=error.__class__.__name__, | ||
| msg=": " + str(error) if str(error) else "", | ||
| ) | ||
| logger.info("Error in populating TABLE: {} - KEY: {}\n\t Error Message: {}".format(self.target.table_name, key, 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.
| logger.info("Error in populating TABLE: {} - KEY: {}\n\t Error Message: {}".format(self.target.table_name, key, error_message)) | |
| logger.info(f"Error making {self.target.table_name}: {key} - {error_message}") |
datajoint/autopopulate.py
Outdated
| return key, error if return_exception_objects else error_message | ||
| else: | ||
| self.connection.commit_transaction() | ||
| logger.info("Successful in populating TABLE: {} - KEY: {}".format(self.target.table_name, key)) |
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.
| logger.info("Successful in populating TABLE: {} - KEY: {}".format(self.target.table_name, key)) | |
| logger.info(f"Success populating {self.target.table_name}: {key}") |
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.
Do we really want to log so much?
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.
This is to facilitate the "notification" mechanism, e.g. having clear and distinct log messages so that it can be parsed easily by some custom loghandler and then fed into some notification scheme (e.g. send emails, slack messages, etc.)
Hence I purposely have the log message being a bit wordy but hopefully distinctive - Start populating TABLE, Error in populating TABLE, etc. - so that it is easy to parse the log later.
Making... or Error making... may just be too generic.
|
These logs should be Also, since this is superseded by #1031, closing this. |
No description provided.