Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Software Architecture with Python

You're reading from   Software Architecture with Python Design and architect highly scalable, robust, clean, and high performance applications in Python

Arrow left icon
Product type Paperback
Published in Apr 2017
Publisher Packt
ISBN-13 9781786468529
Length 556 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Anand Balachandran Pillai Anand Balachandran Pillai
Author Profile Icon Anand Balachandran Pillai
Anand Balachandran Pillai
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Principles of Software Architecture FREE CHAPTER 2. Writing Modifiable and Readable Code 3. Testability – Writing Testable Code 4. Good Performance is Rewarding! 5. Writing Applications that Scale 6. Security – Writing Secure Code 7. Design Patterns in Python 8. Python – Architectural Patterns 9. Deploying Python Applications 10. Techniques for Debugging Index

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 to debug at different levels of logging to extract the information they want, and figure out the problem.

  • Custom loggers can be written, which can perform logging to various outputs. At its most basic, logging is done to log files, but one can...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image