Python logging: stop using print in your Python code for logging, use the logging module like a pro

Let’s use logging in Python from now on

When we write Python programs, we often need to print out the results and also log some exceptions. As a beginner, we would normally use the print function to log everything. It is handy to use the print command but the logs are not stored properly and are difficult to check sometime after the program is finished.

--

--

I’m a Software Developer (https://www.superdataminer.com) keen on sharing thoughts, tutorials, and solutions for the best practice of software development.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Lynn Kwong

I’m a Software Developer (https://www.superdataminer.com) keen on sharing thoughts, tutorials, and solutions for the best practice of software development.