Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1614

Python Logging is configured by default on PySide6

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 6.1.3
    • 6.1.2
    • PySide
    • None
    • Linux KDE
    • Linux/X11
    • 9daa6fd5497226733d74490c03990e8d5a88d8d2 (pyside/pyside-setup/dev) 8f81f5b1f445530c1f6214b3d16c0b4b8493607b (pyside/pyside-setup/6.1)

    Description

      import logging
      logger = logging.getLogger(__name__)
      
      def main():    
          app = QApplication(sys.argv)
          window = QLabel('Window from label')
          window.show()
          logger.info("Logging is already configured?")
      
          app.exec()    
      
      if __name__ == "__main__":
          main()
      

      This code by itself shouldn't print anything to the console. However it seems that PySide6 configures python logging module.

      This doesn't happen in PySide2.

      Python 3.8
      Qt 6.2.0 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 9.3.0)
      logger.getEffectiveLevel()= 20
      Enabled 50
      Enabled 40
      Enabled 30
      Enabled 20
      INFO:__main__:Logging is already configured?
      
      Python 3.8
      Qt 5.15.4 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.3.1 20160406 (Red Hat 5.3.1-6))
      logger.getEffectiveLevel()= 30
      Enabled 50
      Enabled 40
      Enabled 30
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kleint Friedemann Kleint
              shirokuma Shiro K.
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes