A few years ago, I used the logs to do quick and dirty profiling, since each log message included the thread and a timestamp to the millisecond. By looking at the time differentials between the log messages, I could see what code segments were taking the most time. In that case, most of the time spent waiting for HTTP responses, which was actually rather predictable.
The point remains, which is that just about any log message could contain information that would turn out to be useful in some unforeseen future situation.
I prefer my log messages to contain information that is likely to be useful, so that's why log statements that I write tend to be like
log("variable1="+variable1+",variable2="+variable2+",variable3="+variable3);
and don't have the verbiage that log statements written by other people have.
No comments:
Post a Comment