title: How to define format in logging.basicConfig() using python's str.format?
body: <p><a href="https://docs.python.org/3.5/howto/logging.html#logging-basic-tutorial" rel="nofollow noreferrer">Python documentation</a> teaches the following syntax:</p>
  
  <pre><code>import logging
  logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p')
  logging.warning('is when this event was logged.')
  </code></pre>
  
  <p>I would like to express <code>format='%(asctime)s %(message)s'</code> using python str.format. How can I do it?</p>
  
  <p>I tried but had was returned with <code>NameError</code>, which shows that I did not understand how <code>asctime</code> and <code>message</code> was defined. Thanks.</p>
  
  <pre><code>  File "~/test.py", line 163, in main
      format='{}{}'.format(asctime,message),
  NameError: name 'asctime' is not defined
  </code></pre>