title: In a python logging is there a formatter to truncate the string?
body: <p><a href="http://docs.python.org/2/library/logging.html#formatter-objects" rel="noreferrer">Python logging</a> formats strings with a syntax I don't see elsewhere in python, like</p>
  
  <pre><code> 'format': '%(name)s'
  </code></pre>
  
  <p>Is there any way to truncate an error message using the formatter, or do I need to override the LogRecord class for that?</p>
  
  <p>This truncates parts of the message (though I can't find the documentation for this feature in the <a href="http://docs.python.org/2/library/string.html" rel="noreferrer">normal places</a>):</p>
  
  <pre><code> 'format': '%(name).40s %(message).40s'
  </code></pre>
  
  <p>I'd rather truncate the entire formatted message, if possible (for an 80 column console, say).</p>