Recipes: Logging and Debugging¶
Short, task-focused how-tos for specific things you'll want to do while making programs observable and debuggable. Each recipe assumes you already know the basics — if a term surprises you, the Learn section is one click away.
Unlike the tutorials, the recipes don't have a recommended order. Pick whichever is useful right now.
Recipes in this guide¶
- Configure logging for a project — setting up loggers, handlers, and formats once so every module in your project logs consistently.
- Create custom log handlers — writing handlers that send logs to destinations
loggingdoesn't ship with. - Use breakpoints effectively —
breakpoint(), conditional breaks, and getting useful signal out of a debug session. - Avoid common logging mistakes — root-logger gotchas, string-format timing, and other footguns.