This is intended to clean up the logging system for use as a component in other systems. This consists of allowing the user to enable/disable individual stage log files as well as only creating log folders if the particular logging option is enabled.
Reason
Currently, each stage was configured to log to it's own log file using loguru. While this works when they are running in separate processes, it results in duplicate log files when they are run in separate threads within the same process. Allowing them to be disabled individually allows the user to decide if they want each stage to log, or if they want to create their own loguru sink for the whole application.
The system would also create a number of folders that were empty when logging options weren't all enabled. This would make it more difficult to tell which logging options were enable and disabled for a give run, since you would have to search through each folder manually. This was cleaned up by not creating folders when the logging options for that folder weren't enabled.
Method / Design
Changes included:
Add a base stage setting of log_to_file that defaults to on. This controls whether the individual stage log is written for this stage.
Check SaveSettings flags before creating folders to avoid creating empty log folders
Add functions to SaveSettings to group common settings / options into clearer calls for folder creation.
Description
This is intended to clean up the logging system for use as a component in other systems. This consists of allowing the user to enable/disable individual stage log files as well as only creating log folders if the particular logging option is enabled.
Reason
Currently, each stage was configured to log to it's own log file using loguru. While this works when they are running in separate processes, it results in duplicate log files when they are run in separate threads within the same process. Allowing them to be disabled individually allows the user to decide if they want each stage to log, or if they want to create their own loguru sink for the whole application.
The system would also create a number of folders that were empty when logging options weren't all enabled. This would make it more difficult to tell which logging options were enable and disabled for a give run, since you would have to search through each folder manually. This was cleaned up by not creating folders when the logging options for that folder weren't enabled.
Method / Design
Changes included:
Testing
Compiled and run on: Ubuntu 20.04 - Desktop
Other Notes