logger#

Handles setup of the debug log.

setup()[source]#

Configures event logging for the application.

logs_folder() Path[source]#

Returns the folder containing the log files.

rotation_filename(path: Path) Path[source]#

Monkey-patches the logging handler’s file renaming mechanism so that, on roll-over, log files from previous days get the actual date, and only that, as the file name, and have .txt as the suffix.

Note: A proper implementation would also have to override the getFilesToDelete() method. But this here works for our use case where we never purge logs. Refer to the source code for further details.

timed_records(*args, **kwargs) LogRecord[source]#

Adds a relative timestamp to the log record attributes.

Example usage:

logging.setLogRecordFactory(timed_records)
logging.basicConfig(format='[%(timestamp)s] %(message)s')