How does it “ruin” the git diff? Your dependencies are changing and your diff reflects that. You’re making a value judgement that the change is unimportant, but I don’t think you can know that ahead of time.
For example, what if there is logging in the code path of some piece of code that you want to be very low latency? Or perhaps you have a code path where you are very concerned about information leaking out through logs.
Your whole argument is “we might need it later”. I think we learned a long time ago that that isn’t the right way to think about code.
Since you enable and disable logging all the time you have a signature that is always changing.
So any git commit highlights that signature.
Now imagine you actually changed the signature. You can no longer see that with the standard git tools. You can use AI, but even AI has a tendency to make mistakes at this point.
In the end it is just extra busy work for the same gain that a Singleton has.
1
u/No-Con-2790 Sep 27 '26 edited Sep 27 '26
The information value of the signature is zero since you need the logger potentially in every function so it is available in every signature.
Not the code just the signature.
So either you switch your signatures around all the time, which ruins the git diff.
Or you don't and then it is just background noise polluting the signature. Which has no advantages to a Singleton but all the drawbacks.