A maintainability problem occurs when logging instructions make source code harder to read. Excessive log messages can crowd simple logic and obscure its behavior. section 4.2.3
Review logging for these warning signs:
- Log statements interrupt the main logic instead of clarifying important behavior. section 4.2.3
- A simple operation becomes difficult to follow because every step and intermediate value is logged. section 4.2.3
Extracting digits
A compact extractDigits method creates a result list, scans the input, keeps digit characters, and returns the result. A second version logs list creation, iteration, every character, matching characters, additions, and the final list. The extra instructions crowd the same logic and make it harder to read. section 4.2.3
Figure 4.15 Small details can cause big problems. Developers sometimes consider an app’s logging capability harmless by default and disregard the problems logging can introduce. Logging, however, like all the other software capabilities, deals with the data, and wrongly implemented, it can affect the app’s functionality and maintainability.
Use the figure to connect seemingly small logging choices with broader functionality and maintainability risks. section 4.2.3






