0
0
Drone Programmingprogramming~10 mins

Logging and log analysis in Drone Programming - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to log an info message using the drone's logging system.

Drone Programming
drone.log.[1]("Mission started successfully.")
Drag options to blanks, or click blank then click option'
Awarn
Berror
Cinfo
Ddebug
Attempts:
3 left
💡 Hint
Common Mistakes
Using error or warn instead of info for normal messages.
2fill in blank
medium

Complete the code to log a warning when battery is low.

Drone Programming
if battery_level < 20:
    drone.log.[1]("Battery low: please land soon.")
Drag options to blanks, or click blank then click option'
Awarn
Berror
Cinfo
Ddebug
Attempts:
3 left
💡 Hint
Common Mistakes
Using info instead of warn for warnings.
3fill in blank
hard

Fix the error in the log statement to correctly log an error message.

Drone Programming
drone.log.[1]("Failed to connect to GPS module")
Drag options to blanks, or click blank then click option'
Awarn
Bdebug
Cinfo
Derror
Attempts:
3 left
💡 Hint
Common Mistakes
Using warn or info instead of error for errors.
4fill in blank
hard

Fill both blanks to filter logs for error level and above, and format the output.

Drone Programming
drone.log.setLevel([1])
drone.log.setFormat([2])
Drag options to blanks, or click blank then click option'
A"ERROR"
B"INFO"
C"json"
D"plain"
Attempts:
3 left
💡 Hint
Common Mistakes
Setting level to INFO shows too many logs.
Using plain format for structured analysis.
5fill in blank
hard

Fill all three blanks to create a log filter that shows warnings and errors, formats logs as plain text, and includes timestamps.

Drone Programming
drone.log.setLevel([1])
drone.log.setFormat([2])
drone.log.includeTimestamp([3])
Drag options to blanks, or click blank then click option'
A"WARN"
B"plain"
Ctrue
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using ERROR level hides warnings.
Not including timestamps makes logs less useful.