8 ms·
Yes, debug logging is a great way to encode educated guesses about where unexpected behavior will appear in the future, in a way that should save time on net wh
by chrchang523 4y ago
Yes, debug logging is a great way to encode educated guesses about where unexpected behavior will appear in the future, in a way that should save time on net when a guess is correct.
But one should be aware of its limits. Debugging often involves performing something like a binary search over a collection of suspicious assumptions. The first few well-placed debug-logging messages can save several iterations in these binary searches. But the cost of saving one more binary search iteration in this manner increases exponentially. As with so many other things in engineering, moderation is a virtue; you want good debug-logging and an ability to perform quick manual tweaks to the code to cover the "last mile" of a debugging session, when this is at all possible in your execution environment.