Correct way of interpolating a value to a log message
<p>Is there some best practice for interpolating values into a log message? My google-fu is not effective here, but I get examples like <a href="https://code.djangoproject.com/ticket/17358" rel="nofollow">this</a> which say:</p>

<pre><code>#Change all logging from this

logger.warning("This is a %s" % var)

#to

logger.warning("This is a %s", var)
</code></pre>

<p>like its a best practice everybody must follow. Is there a reason? Will any values of <code>var</code> (like an object of a class) fail here?</p>
