title: Logging in Python using the Python 3 string-formatting syntax
body: <p>When I write a message to a Python logger, and the message has parameters, I now write it like this:</p>
  
  <pre><code>logger.info("Person %s cuts at %f.", person.name, location)
  </code></pre>
  
  <p>This is the old way of string-formatting; the new way would be:</p>
  
  <pre><code>logger.info("Person {} cuts at {}.", person.name, location)
  </code></pre>
  
  <p>but this raises an error. I could convert the message into a single string like so:</p>
  
  <pre><code>logger.info("Person {} cuts at {}.".format(person.name, location))
  </code></pre>
  
  <p>However, in this case the string is generated even when the log message should not be displayed, e.g. when the logging level is WARNING. This is wasteful.</p>
  
  <p>My question is: how can I write a log message that does not automatically expand its parameters, while using the new syntax for string formatting?</p>