Yet another Real Python article to the rescue! Well, not that I was specifically seeking to read this but it popped out as I was reading about Threading in Python and naturally, I wanted to read this one out of curiosity. After a few seconds of digging, I realized I was following a bad programming practice this whole time — I was using print
statements to debug my code! It appears that using the logging library Python provides is not only a cleaner and more standardized way of logging the progress/errors/warnings of a program but it is flexible in functionality, easy to use, and far more convenient in the long run.
I wrote my own logger config (not a big deal tbh, I just followed the example in the RealPython article — Once I start using it more often, I may eventually see the need to expand on my config, let’s see how that goes), which I will use for all my future Python scripts, if the need arises