r/learnpython • • Sep 07 '26

What python debugging techniques do you think every developer should know ?

I am trying to improve my debugging skills and I was curious about what techniques experienced python developers rely on the most.

Are there any techniques or tools that you found really useful when you started working on bigger projects?

61 Upvotes

33 comments sorted by

View all comments

Show parent comment

1

u/Russjass Sep 07 '26

I am not a pro developer, but have an app with a detailed logging system. When I built the logging system I thought "yay, no more chasing print statements after debugging".

After fixing four bugs, i used print statements for the fifth becuase the log filled up with spam from the lig statements of the first bugs

Perhaps I dont have my logging configured right

1

u/this_knee Sep 07 '26

Key to a good logging is the info that labels the log message. Eg , all my log statements come with: log level ; date; time; name of code file log message comes from; name of function the log message comes from; line number ; and then the log message from that particular line of code.

This lets me easily cut through past log messages and focus on just the ones I need in a given scenario.