Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
6.1.2
-
None
-
macOS Catalina 10.15.7, Python 3.9.6. Similar behavior reported on Linux (version unknown).
Description
When importing PySide6 into a Python script that has logging set up with the default `logging` module, PySide6 adds an extra handler to the root logger.
This requires the following code in order to get the normal behavior from the logger:
# Create the logger
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
# Remove PySide6 (or other) handlers
for h in logger.handlers:
logger.removeHandler(h)
I have confirmed this issue by running clean scripts with nothing in them but logging code. They work as intended until PySide6 is imported.
Please see the following posts for details:
- Stackoverflow : https://stackoverflow.com/questions/68772470/cant-get-my-head-around-logging-in-multiple-modules (see comments)
- Qt Forum : https://forum.qt.io/topic/129370/pyside6-disables-logging-debug-level/4
Thanks.
Attachments
Issue Links
- duplicates
-
PYSIDE-1614 Python Logging is configured by default on PySide6
- Closed