Additional Context
I make infrastructure for automated device testing. Debugging can be very time consuming because the devices have many states and are constantly being updated with new builds which might break assumptions that we've made.
Background
A TL who doesn't work on the project that I'm working on is reviewing a commit which I'm also reviewing. The author wrote something along the lines of
print("Entering into method_a")
I commented that we have a decorator which will do this for him and provide the args that are called. The logline produced would be something like:
Infra calling method_a("string_arg", ["list", "elements"], arg3=True)
He said he doesn't like the pattern of logging every method we call. Granted, I don't like excessive logging either and I don't suggest to log every method. However, it's been my experience on this project, and many others, that good logging is very helpful for debugging. He suggested that the stack trace in Python should be adequate.
In my opinion there are a number of cases for added logging:
- To know what functions/methods have previously been called. Especially ones that change the state of something.
- To orientate myself in the logs.
- To know what arguments have been passed into the function that crashed. That's not available in the StackTrace.
This TL is someone who doesn't like to be disagreed with and he doesn't want to discuss it much further suggesting that it is something which naturally follows from system design.
Similar questions that do not answer my question
Question
I would like to understand what the alternatives are to verbose logging. How does this relate to system design? How would testing, refactoring, and tool usage avoid the need for verbose logging?
Edit
I have asked this TL about the alternatives he mentioned and he brushed off the question suggesting that it is something that extends naturally from system design. I suspect that pressing the matter with him will not yield positive results - as mentioned above, he is someone who doesn't like to be disagreed with.