recorder
– Flight Data Recorder¶
CodeAIR: Flight Data Recorder
-
class
codeair.recorder.
FlightDataRecorder
(filename=None, abort=<function _emergency_landing>)[source]¶ A class to record flight data and handle logging.
-
abort
¶ The function to call on an unhandled exception.
- Type
function
Initializes the FlightDataRecorder with a log file and abort function.
-
log
(message)[source]¶ Logs a message to the file with a timestamp.
- Parameters
message (str) – The message to log.
-
log_exception
(e)[source]¶ Logs an exception with a traceback.
- Parameters
e (Exception) – The exception to log.
-
print_report
(check_connection=True)[source]¶ Prints the contents of the previous log file to the console.
- Parameters
check_connection (bool) – If True, check if CodeSpace is connected before reporting.
-