O'Reilly logo

Software Architecture with Python by Anand Balachandran Pillai

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Logging as a debugging technique

Python comes with standard library support for logging via the aptly named logging module. Though print statements can be used as a quick and rudimentary tool for debugging, real-life debugging mostly requires that the system or application generate some logs. Logging is useful because of the following reasons:

  • Logs are usually saved to specific log files, typically, with timestamps, and remain at the server for a while until they are rotated out. This makes debugging easy even if the programmer is debugging the issue some time after it happened.
  • Logging can be done at different levels—from the basic INFO to the verbose DEBUG levels—changing the amount of information output by the application. This allows the programmer ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required