app_logger module¶
- enable_app_logging(level='info', log_to_file=False)¶
This function enables logging for the editing framework.
- Parameters:
level (str) – The logging level to set. Can be one of “debug”, “info”, “warning”, “error”, or “critical”. Defaults to “info”.
log_to_file (bool) – if True, logs will also be written to a file named “app.log”. Defaults to False. This file should not be saved in the repository, as it will contain sensitive information in the logs.
- Raises:
TypeError – If level is not a string.
TypeError – If log_to_file is not a bool.
FileNotFoundError – If cannot find ‘work’ folder.
ValueError – If the provided logging level is not valid.
RuntimeError – If logging is already enabled.
- Return type:
None
Note
The logging output will be sent to both the console and a file named “app.log”. Also adds a logging message to indicate that the app was started. This is to make it possible to differentaiate different sessions.