https://github.com/mjiggidy/qtlogrelay
Relay logged events from python's logging module to a PySide6 application via a QtCore.Signal.
https://github.com/mjiggidy/qtlogrelay
handler logger logging loghandler pyside pyside6 python python3 qt qt6 qtwidgets signal
Last synced: about 2 months ago
JSON representation
Relay logged events from python's logging module to a PySide6 application via a QtCore.Signal.
- Host: GitHub
- URL: https://github.com/mjiggidy/qtlogrelay
- Owner: mjiggidy
- License: gpl-3.0
- Created: 2025-08-11T23:59:46.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-08-12T01:29:59.000Z (11 months ago)
- Last Synced: 2025-08-12T02:39:35.556Z (11 months ago)
- Topics: handler, logger, logging, loghandler, pyside, pyside6, python, python3, qt, qt6, qtwidgets, signal
- Language: Python
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
qtlogrelay
==========
`qtlogrelay` is a python module for the `QtLogRelayHandler` class.
`QtLogRelayHandler` is a `logging.Handler` which relays logged events from python's `logging` module
to a PySide6 application via a `QtCore.Signal`.
Basic Usage
-----------
Create an instance of `QtLogRelayHandler` and install it as a log handler for your python logger.
Then connect the `QtLogRelayHandler.logEventReceived` signal to an appropriate slot to do what you need to do in your PySide6 application.
```python
# Add a `QtLogRelayHandler` to this module's logger
qtloghandler = QtLogRelayHandler()
logging.getLogger(__name__).addHandler(qtloghandler)
# Now we can connect to that handler's signal to do stuff with the `logging.LogRecord` object
qtloghandler.logEventReceived.connect(
processLogRecord,
QtCore.Qt.ConnectionType.QueuedConnection
)
```
See `examples/basic.py` for a functioning example.