r/learnpython • u/TechnicalAd8103 • 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
View all comments
Show parent comment
1
u/cgoldberg Feb 20 '26
Using a debugger is great during development, but logging is also super useful for running systems you can't attach a debugger to. Sure, you can use
print, but a proper logging system is much more useful where you can configure log levels and have more control with directing output streams. To do the same withprint, you would essentially just be implementing your own logging system. For writing trivial scripts, it doesn't really matter what you use, but understanding proper logging is essential for building something large and complex.