laxnpander / OpenREALM

OpenREALM is a pipeline for real-time aerial mapping utilizing visual SLAM and 3D reconstruction frameworks.
GNU Lesser General Public License v2.1
466 stars 119 forks source link

Add logging flag and only create folders if we plan to write data #53

Closed zthorson closed 3 years ago

zthorson commented 3 years ago

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

zthorson commented 3 years ago

Any changes needed to merge this?

laxnpander commented 3 years ago

@zthorson: Nope, looks good!