Skip to main content

Qt Custom UI Log for Maya/Houdini

Project description

PyPI version PyPI Supported Python Versions Message

QtLog

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

PySide2/Python3 - Maya +2022, Houdini +19, Nuke +13
PySide6/Python3 - Maya +2025

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 qtlog.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 qtlog.qt_ui_logger import QtUILogger

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

In you qt app, you can use the QtUILogger to display the 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')

Lastly, when you close the app, remove the loggers from the widget by overriding the closeEvent() method.

    def closeEvent(self, event):
        """Remove the widget from the loggers, call .close() on closeEvent()."""
        self.loggers.close()
        self.close()

See the full example tool in the examples folder.

Install

pip install qt-log

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qt_log-1.1.3.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qt_log-1.1.3-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file qt_log-1.1.3.tar.gz.

File metadata

  • Download URL: qt_log-1.1.3.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.11.6 Windows/10

File hashes

Hashes for qt_log-1.1.3.tar.gz
Algorithm Hash digest
SHA256 835d73d915acfe2d2847137955788ac2fc469189786e440ee95070ab8c97567f
MD5 b6ad53039ea73f439b8fb7b0f6f4df2d
BLAKE2b-256 2ca203491fa143698d4e1a91f384af371a6aa7db48f6232d34e25925304c6e2f

See more details on using hashes here.

File details

Details for the file qt_log-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: qt_log-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.11.6 Windows/10

File hashes

Hashes for qt_log-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 996a6aa2723c89467cefe2dcfcfd14a0905eeb358224af87b926e342db365cf4
MD5 259f0906b4dcc009ed6192c2f2fdfbad
BLAKE2b-256 09be9992c3e9b03d5daa11ee2ebffc38f16f3380f97e867290d2c8281edf0c6e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page