[DRAFT] add more logging for populate()#1029
[DRAFT] add more logging for populate()#1029ttngu207 wants to merge 2 commits intodatajoint:masterfrom
populate()#1029Conversation
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.
| 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.
| 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.
| 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.
Do we really want to log so much?
There was a problem hiding this comment.
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.