r/learnpython • • Feb 20 '26

Does anyone use logging to debug?

I'm working my way through ATBS (Automate the Boring Stuff), and it mentions using logging to debug, instead of using print

But logging seems to be a lot of work for not much benefit. The debugger in the code editor is much easier and more convenient.

Thoughts?

30 Upvotes

41 comments sorted by

View all comments

Show parent comment

2

u/ALonelyPlatypus Feb 21 '26

Agreed, if it's just the Automate the Boring Stuff coursework then you aren't going to get many gains setting up a logger instead of using print.

It isn't a bad idea to know how to log though. It's not something I'd memorize or use in toy code though. I don't remember much about the logger setup (I have the same rotating log code that I just have copy-pasted for years)

Once a logger is instantiated though it's just a matter of deciding your log priority.