On 02/26/2015 05:30 PM, Dan Smith wrote:
Why does it work? No clue! :) Why write it? So when we are handed a log from a user, we know what version it came from. That would be doubly useful if the daily builds munge the version with the build date (which I haven't investigated, so I don't know either way).
Obviously the version should be in the logs, and it currently is. Clearly I need to be more explicit:
Why write it instead of log it?
Because logging may not always get it in the log file.
The version should appear in log files regardless of the configured logging level. As far as I can tell, there is no way to do that with the logging module. Conversely, it should never appear on the console.
Can you please stop speaking so definitively? If we're logging debug messages to the console, then I definitely think the version belongs there. For example:
Okay, I should have said "it should never appear on the console _unless the logging level is DEBUG_".
As far as speaking definitively goes, please realize that's just me trying to use a simple, clear, and direct way of writing. Please do not confuse "definitive" with "authoritative", as I will readily admit that my statements aren't worth beans unless you agree with them.
Further, if we're logging only info messages to a file, that's not going to be that useful for triaging an issue, so I don't think it matters one way or the other. The whole point of converged logging is to have the same thing (modulo the given level) appear in whatever log stream(s) we have.
After considering your examples, you have convinced me that you are right, in so far as the debug.log will always have it (since it will always be at DEBUG level) and the console or log should have it (if at DEBUG level). The other use cases don't matter as much as those. Thus, I concede: it should be a LOG.debug statement. I'll change it.