4 ms·
Logging can be different, and that's okay. It is non-interactive side-effect and irrelevant to the function of your code. It's just for diagnostics, like a deb
by paulddraper 9y ago
Logging can be different, and that's okay.
It is non-interactive side-effect and irrelevant to the function of your code. It's just for diagnostics, like a debugger.
If that is not true, I wouldn't call it "logging" for the proposes here.
You could inject a logger, but I don't see a reason to.
https://softwareengineering.stackexchange.com/questions/275957/is-logging-next-to-an-implementation-a-srp-violation https://softwareengineering.stackexchange.com/questions/2759...
- sagichmal 9y agoLogging is absolutely not irrelevant to the function of your code. It's a cornerstone of system observability along with instrumentation (metrics) and tracing. It deserves to be unit-tested, same as anything else. Loggers absolutely deserve to be injected and treated the same as any other first-order dependency.
- paulddraper 9y agoEh. You can use gdb for tracing too. I don't see any hard in gloably DI'ed system observability.
- paulddraper 9y ago*harm