Making the directory for telemetry logs configurable
Closed this issue · 2 comments
While writing the first project on the FCND, I found useful to save the telemetry for each run on a different file to analyze them separated later on. I managed to do that by initializing the Drone
class with a different tlog_name
taking into account the initial execution timestamp to create a new file each time. I would prefer to have a directory for each execution, but the current API doesn't provide an extension point for that. One possible solution is to provide an optional parameter to configure the directory in addition to the log name (e.g. tlog_directory
).
A more exciting solution but implying breaking changes on the API is to add an optional parameter allowing to inject a Logger
instance for telemetry. The Logger
creation won't be done after the listener for MsgID.ANY
is set; so, it will decrease a potential loss of the first couple of telemetries. In addition to allowing more flexibility on which Logger
to use. @classmethod
methods could be provided to make the user's life easier if they just want to change a single parameter (e.g., just tlog_name
or just tlog_directory
) or the functionality I implemented regarding one file/directory for each execution.
Please, let me know if there is interest in these ideas to fork the repo and create PR later on.
+1