promptdojo_

Arguments, defaults, and the silent wrong-order bug — step 9 of 9

Checkpoint

One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.

Last one. Cursor wrote a function format_log that's supposed to take a message, an optional level (default "info"), and an optional source (default "app"), and return a string like [info] app: started.

The signature is wrong (defaults in the wrong order) and the function body is missing entirely. Fix the signature and write the one-line body that returns the formatted string.

Two calls happen at the bottom — they should print:

[info] app: started
[warn] auth: login failed

full-screen editor opens — close anytime to keep reading.