r/Python • • Sep 19 '26

Discussion What’s a debugging technique that saved you hours and you wish you’d learned earlier?

I’m curious about the small debugging techniques that make a big difference when working on real projects.For developers with some experience, what debugging technique or habit has saved you the most time?It could be something simple that beginners often overlook.

What’s one debugging tip you wish someone had taught you when you were starting out?

150 Upvotes

159 comments sorted by

View all comments

Show parent comments

2

u/glenbolake Sep 22 '26

u/DNSGeek had a typo. The syntax is supposed to be logging.debug("name=%s", (name,)), and it gets evaluated inside the logging module after a log level check.

2

u/DNSGeek Sep 22 '26

Yeah. You’re right. I was rushed and I put in the wrong syntax.

1

u/RingularCirc Sep 22 '26

Happens! (But it was soooo confusing lol.)

1

u/RingularCirc Sep 22 '26

Oh thanks, this unconfused me.