4 ms·
Yeah but... aren't you tempted to leave the debugging code, in case you might need it again later?
by GnarfGnarf 4y ago
Yeah but... aren't you tempted to leave the debugging code, in case you might need it again later?
- gary_0 4y agoTo me it seems like if it's really that important, it becomes error checking or assertion code, or the code should be refactored to better enforce invariants, or the debug code is spun off into unit tests. That way whatever problem I was trying to detect is checked automatically in the future. And I admit an aesthetic preference for less logging code scattered about. But I haven't found it very useful to barf lots of data into a debug log and then hope to find something useful sifting through it when there's a problem. Maybe it's just one too many information-dense things to juggle for me and smarter people have more luck with this approach. I'm not totally against the idea, I just haven't found a way that works for me.
- GnarfGnarf 4y agoThis is where you need to get creative: save the log as HTML, and use colors, tables, etc. to organize the data, catch error needles amongst the data haystack, etc. I find that having lots of trace data is useful because at a glance, you can compare problem situations against normal profiles and patterns.