title: python logging output on both GUI and console
body: <p>Given this little snippet:</p>
  
  <pre><code>import sys
  import os
  import logging
  from PyQt5 import QtGui, QtWidgets, QtCore
  
  log = logging.getLogger("Foo")
  logging.basicConfig(
      level=logging.INFO, format='%(levelname)s: %(filename)s - %(message)s')
  log.setLevel(logging.DEBUG)
  
  
  class ConsolePanelHandler(logging.Handler):
  
      def __init__(self, parent):
          logging.Handler.__init__(self)
          self.parent = parent
  
      def emit(self, record):
          self.parent.write(self.format(record))
  
  
  class Foo(QtWidgets.QWidget):
  
      def __init__(self, parent=None):
          QtWidgets.QWidget.__init__(self, parent)
  
          self.textEdit = QtWidgets.QTextEdit(self)
          self.textEdit.setLineWrapMode(QtWidgets.QTextEdit.NoWrap)
          self.textEdit.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
  
          vbox = QtWidgets.QVBoxLayout()
          self.setLayout(vbox)
          vbox.addWidget(self.textEdit)
  
      def write(self, s):
          self.textEdit.setFontWeight(QtGui.QFont.Normal)
          self.textEdit.append(s)
  
  
  if __name__ == "__main__":
      app = QtWidgets.QApplication(sys.argv)
      console_panel = Foo()
      handler = ConsolePanelHandler(console_panel)
      log.addHandler(handler)
  
      log.info("Getting logger {0} - {1}".format(id(log), log.handlers))
      [log.debug("This is normal text " + str(i)) for i in range(5)]
      console_panel.show()
  
      sys.exit(app.exec_())
  </code></pre>
  
  <p>Questions: </p>
  
  <ul>
  <li>Why is log writing to both the console and gui? As far as i know <code>log.handlers</code> len should be only 1. </li>
  <li>How can i write only to the gui supressing the console messages?</li>
  <li>Why the gui format is not the one specified by basicConfig?</li>
  </ul>