© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
S. AlmogPractical Debugging at Scalehttps://doi.org/10.1007/978-1-4842-9042-2_4

4. Logging, Testing, and Fail-Fast

Shai Almog1  
(1)
Tel Aviv, Israel
 

Pain that has not yet come is avoidable.

—Patanjali

This is a chapter about preventing future pain. We can significantly impact our future debugging experience by writing code that’s easier to debug. Many best practices such as KISS,1 DRY,2 etc., will significantly improve your debugging experience. While this isn’t a book about best practices, I will focus on a few that make debugging easier and failures manageable. One such best practice is fail-fast; it lets us detect a bug when it’s closer to the symptom.

Logging ...

Get Practical Debugging at Scale: Cloud Native Debugging in Kubernetes and Production now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.