I’m learning to see the helpfulness of good logging. There’s already a good logging discipline here around me. My program was terminating abnormally and I couldn’t figure out where the problem was coming from. I fired up the debugger* and was able to figure out what the problem was. Then I looked back in the log files to see if I could have divined from the log output where the issue was. Yes, I could have. Here’s the end of the log file:
Notice all the functions being entered, but not left? (the squares with arrow pointing to right) We can see that about the last thing that’s in process is loading from an xml file. I checked my machine and …I was missing that xml file. I could have saved myself a lot of wasted time fiddling with my source code, reverting to previous versions, rebooting machines, and the like, if I had been able to recognize the signs of something wrong when I looked at this the first time.
*(without copying source code — how that worked is worthy of a separate post)