Want your code to be easy to observe? Use dependency injection for observability concerns. Sounds dry. Hear me out.
The problem
Your code calls log.info(...) directly. In tests, you can't verify what was logged. In prod, if you want to change the logger, you're grepping the codebase. If you want to add tracing, you're editing every call site.
Same for metrics. Same for tracing. Same for error reporting.
The fix






