>> If I have a choice between writing: >> >> log.debug( >> "HOME environment variable set to non-existent directory %s", >> homedir >> ) > > with the mapping in my previous posting you would write > > log.debug( > "HOME environment variable set to non-existent directory " + homedir > ) >>>>> "A" == Aahz <aahz@pythoncraft.com> writes: A> There is no difference between these two. I'm coming in in the middle of this thread, but there is a very important difference between these two. The latter does more work because it does a string concat before log.debug() is called. Which means if the logging level is such that the message is suppressed, you've just wasted some time and memory. The former can avoid all that by just not doing the string interpolation if it's just going to throw away the log message. I use the first form in Mailman's own logging system and I think it's a win. I don't know which form is being argued for here, but the first has my +1, the second a -1. -Barry
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4