4 ms·
i was debugging some very terse, elegant, and dense code. i added a bunch of logging throughout to understand what was going wrong. someone then removed all of
by josephorjoe 5y ago
i was debugging some very terse, elegant, and dense code. i added a bunch of logging throughout to understand what was going wrong.
someone then removed all of my logging because it was ugly.
and then had to put it all back in when another bug was coming from the same terse beautiful code.
- daenz 5y agoThat hurt me to read! Have you communicated this to your manager? Might be worthwhile to have a decision "from the top" that is essentially: all logging is good, so long as it doesn't hurt performance or contain PII/PHI.
- sharken 5y agoLogging is like a lamp in the dark, you need it.
- knighthack 5y agoI love how poetic this sounds.
- josephorjoe 5y agothree things i find to be true of every web app i work on: 1. good logging is the most important part of the app. whatever the app is meant to do is secondary. the app should be a logging app first, and then a backend service to sell widgets second. 2. assume performance requirements for request latency and transactions per second will be at least 3x whatever the product owner tells you at the start of the project and plan accordingly. never trust any suggestion that you can 'ignore performance for now'. 3. the UI may be more important than logging
- swader999 5y agoLogging at the boundaries or seems is especially helpful.
- fighterpilot 5y agoCan you elaborate on what you mean by a boundary? You mean logging the interface between two services or modules?
- mikepurvis 5y agoBoundaries between anything. I recently was dealing with an issue in a Jenkins pipeline, where I didn't realise that state was being serialized to string form between job stages until I explicitly logged it out. The thing that was a list in the previous stage was suddenly a string, but then Groovy would happily accept the join method on a string because it's still an iterable. Auuugh.
- swader999 5y agoBoth these above are great answers. It's a bit of an art.
- eps 5y agoShould've put it into a branch and added an one-line comment to that effect to the master.
- BurningFrog 5y agoA better approach is usually to write test covering all edge cases.