 <p>Recently, I was looking for that too. I think I got pointed to the solution here on SO, but I only have the final url at hand. This is what I do:</p> <pre><code># http://plumberjack.blogspot.de/2010/10/supporting-alternative-formatting.html class BraceMessage(object): def __init__(self, fmt, *args, **kwargs): self.fmt = fmt self.args = args self.kwargs = kwargs def __str__(self): return self.fmt.format(*self.args, **self.kwargs) _F = BraceMessage </code></pre> <p>Can be used like this:</p> <pre><code>logger.debug(_F("foo {0} {quux}", bar, quux=baz)) </code></pre> <p>The formatting will only take place in the very moment the message is evaluated, so you don't lose lots of performance if a log level is disabled. The author of that snippet above made this (and some other utilities) available as a package: <a href="http://pypi.python.org/pypi/logutils/" rel="nofollow"><code>logutils</code></a>.</p>