Skip to main content

PyPI version PyPI Supported Python Versions Message

QtLog

Custom Python Log with colored message display for Maya/Houdini/Nuke

PySide6/Python 3.9+

Message Levels

log = get_stream_logger('my_log')

log.info('test info')  # white
log.warning('test warning')  # orange
log.error('test error')  # red
log.critical('test critical')  # purple
log.debug('test debug')  # yellow
log.ok('test ok')  # sky blue
log.file('test file')  # super light blue
log.process('test process')  # light blue
log.done('test done')  # green
log.hint('hint to the user')  # yellow

Example APP ScreenShot

Usage

Import the logger and create a logger instance, you can create multiple loggers and output them into the same widget.

from qt_log.stream_log import get_stream_logger

log = get_stream_logger('MyToolLog')
log_ext = get_stream_logger('SomeOtherExternalLog')

Import the QtUILogger widget and create an instance of the widget, passing the app, the layout widget and the loggers, a layout widget is required.

from qt_log.qt_ui_logger import QtUILogger

# Inside your app
self.loggers = QtUILogger(
    parent=self,
    layout_widget=self.ui.log_layout,
    loggers=[log, log_ext],
)

Create QtUILogger on the Qt GUI thread after constructing QApplication. The parent must be a QWidget, the destination must be a QLayout, and every logger must be a logging.Logger. Repeated references to the same logger are attached only once.

In your Qt app, you can use QtUILogger to display log messages in a widget.

log.info('Message')
log.warning('Message')
log.error('Message')
log.critical('Message')
log.debug('Message')
log.ok('Message')
log.file('Message')
log.process('Message')
log.done('Message')
log.hint('Message')

Records can be emitted from worker threads. Display updates are queued to the Qt GUI thread, so the widget changes when the Qt event loop processes pending events. Pending display records are bounded at 4,096; under sustained overload, the oldest pending record is discarded. Use self.loggers.dropped_records and self.loggers.peak_pending_records to monitor overload.

When running in Unreal Engine, stream messages are routed through Unreal's native logging API so info, warning, and error records retain their correct Output Log severity. Other hosts continue to use Python's standard logging.StreamHandler.

Lastly, when you close the app, remove the handler from its loggers by overriding closeEvent(). Call the base implementation rather than recursively closing the window.

def closeEvent(self, event):
    """Detach the UI logger before the window is destroyed."""
    self.loggers.close()
    super().closeEvent(event)

Standalone example

Run the host-neutral PySide6 example from the repository root:

uv run python -m example.standalone

The Maya-hosted example remains in example/maya_tool.py and is loaded inside Maya with example.maya_tool.load().

Install

pip install qt-log

Metadata

Release files for qt-log 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qt-log 1.3.1
File Size Uploaded Provenance Actions
qt_log-1.3.1.tar.gz 57.8 kB Without provenance Details for qt_log-1.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qt-log 1.3.1
File Interpreter ABI Platform Actions
qt_log-1.3.1-py3-none-any.whl Python 3 none any Details for qt_log-1.3.1-py3-none-any.whl

Total release size: 65.5 kB

Release files / qt_log-1.3.1.tar.gz

Download URL qt_log-1.3.1.tar.gz
Size 57.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a24327c5eb9782ac8abc4046f11e19f227fd478d31ceceb6236a4ab7521cde8a
BLAKE2b-256 checksum
How to use checksums
e50d3ce3300c95419fa4fe4fe3ca1a9ff867ed9d136c3daaee6e9465f7e9fe1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.9 {"installer":{"name":"uv","version":"0.11.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / qt_log-1.3.1-py3-none-any.whl

Download URL qt_log-1.3.1-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d8efcfd86a96cafdbb20eb8c2a4ace6019b2a6ada692276dda49e8d3451a4c9
BLAKE2b-256 checksum
How to use checksums
89e6e9546cd3f19af531ab05ebbd6128b2872f9aba371890378a9b7e493f7107
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.9 {"installer":{"name":"uv","version":"0.11.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for qt-log 1.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page