title: Python logger: won't overwrite the original log?
body: <p>So, when I copy paste the following x times  to the python prompt, 
   it add the log x times to the end of the designated file. </p>
  
  <p>How can I change the code so that each time I copy paste this to the prompt, 
  I simply overwrite the existing file (the code seems to not accept the 
  <code>mode = 'w'</code> option or I do not seem to understand its meaning)</p>
  
  <pre><code>def MinimalLogginf():
      import logging
      import os
      paths = {'work': ''}
      logger = logging.getLogger('oneDayFileLoader')
      LogHandler = logging.FileHandler(os.path.join(paths["work"] , "oneDayFileLoader.log"), mode='w')
      formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
      LogHandler.setFormatter(formatter)
      logger.addHandler(LogHandler) 
      logger.setLevel(logging.DEBUG)
      #Let's say this is an error:
      if(1 == 1):
          logger.error('overwrite')
  </code></pre>
  
  <p>So I run it once:
      MinmalLoggingf()</p>
  
  <p>Now, I want the new log file to overwrite the log file created on the previous run:</p>
  
  <pre><code>MinmalLoggingf()
  </code></pre>