Complete the code to log an info message using the drone's logging system.
drone.log.[1]("Mission started successfully.")
The info method logs informational messages, which are suitable for general mission updates.
Complete the code to log a warning when battery is low.
if battery_level < 20: drone.log.[1]("Battery low: please land soon.")
The warn method is used to log warning messages that indicate potential issues.
Fix the error in the log statement to correctly log an error message.
drone.log.[1]("Failed to connect to GPS module")
The error method logs error messages indicating failures or serious problems.
Fill both blanks to filter logs for error level and above, and format the output.
drone.log.setLevel([1]) drone.log.setFormat([2])
Setting the level to "ERROR" filters logs to show errors and above. Using "json" format helps structured log analysis.
Fill all three blanks to create a log filter that shows warnings and errors, formats logs as plain text, and includes timestamps.
drone.log.setLevel([1]) drone.log.setFormat([2]) drone.log.includeTimestamp([3])
Setting level to "WARN" shows warnings and errors. "plain" format is readable text. Setting timestamp inclusion to true adds time info to logs.