Logs Are Details

Activity logs are a very important piece of information produced by any entity on this planet, be it a human, a plant, an animal or machine. It is the result of actively measuring and / or observing behaviour and keeping track of it. 

This information is very useful when we have to make decisions or attempt to experiment with another set of parameters in order to compare the outputs. But we have to be aware that logging is not part of the activity, therefore we have to keep it separated from the main activity.

When we are measuring an activity like how much we can run in 5 minutes we have to slap an external device that measures the distance and the time for use because our body doesn’t have those capabilities internally because those details are not essential for the body to function.

In the software world this translates to not writing your business logic and your logging tied together but splitting your business logic so that each operation performs the least amount of relevant work and measure the performance at a higher level. For example the practice of ThrowAndLog, although very handy, forces every Object to be aware of logging when it shouldn’t know anything else other than the domain in which it operates.

In another scenario, when we are learning a new skill there is usually someone, hopefully more experienced, looking over our shoulder, observing our behaviour, taking notes of our behaviour and providing feedback. Yet again these are details related to the activity we are performing and not essential to the activity because you can do the activity without someone observing and taking notes.

Having someone look at you while you swing a kettlebell and take notes of your stance, the position of your hand, your breathing technique, etc. is helpful from time to time but it is still not essential to the activity of swinging a kettlebell.

For these reasons, logging is very helpful when we used with a purpose in mind, to improve our technique so that we can progress to a heavier kettlebell, to reduce the server costs because usage is not that high or for any we might have. But in any case it should be a detail of the system and not built into the system itself.