Arguments, defaults, and the silent wrong-order bug — step 9 of 9
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
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
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.