title: python logging using filename and line number
body: <p>I'm using the basic logging python module to add log. </p>
  
  <p>I decide to create a log class, as follow, named <code>Log.py</code> : </p>
  
  <pre><code>class Log:
      def __init__(self, path):
          self.LOGGER = logging.getLogger('Open-Capture')
          if self.LOGGER.hasHandlers():
              self.LOGGER.handlers.clear() # Clear the handlers to avoid double logs
          logFile = RotatingFileHandler(path, mode='a', maxBytes=5 * 1024 * 1024,
                              backupCount=2, encoding=None, delay=0)
          formatter = logging.Formatter('[%(threadName)-14s] [%(filename)s:%(lineno)-15s] %(asctime)s %(levelname)s %(message)s', datefmt='%d-%m-%Y %H:%M:%S')
          logFile.setFormatter(formatter)
          self.LOGGER.addHandler(logFile)
          self.LOGGER.setLevel(logging.DEBUG)
  
      def info(self, msg):
          self.LOGGER.info(msg)
  
      def error(self, msg):
          self.LOGGER.error(msg)
  </code></pre>
  
  <p>As you can see, I have the <code>%(filename)s:%(lineno)</code> vars to add more lisibility. But in my log file I have <code>Log.py:34</code> instead of filename and line number of the source file because when I log I call it like this : </p>
  
  <pre><code>Log = Log(Config.cfg['GLOBAL']['logfile'])
  Log.info('test log')
  </code></pre>
  
  <p>Is there any way to had the source file on my log file instead of <code>Log.py</code> ? </p>
  
  <p>Thanks in advance</p>