change pyblish MessageHandler emit method to convert messages to string at the moment of emmiting

This commit is contained in:
iLLiCiTiT 2021-05-14 14:11:59 +02:00
parent 80af34403b
commit ecd498df85

View file

@ -67,6 +67,15 @@ def patched_discover(superclass):
@import_wrapper @import_wrapper
def install(): def install():
"""Install Pype to Avalon.""" """Install Pype to Avalon."""
from pyblish.lib import MessageHandler
def modified_emit(obj, record):
"""Method replacing `emit` in Pyblish's MessageHandler."""
record.msg = record.getMessage()
obj.records.append(record)
MessageHandler.emit = modified_emit
log.info("Registering global plug-ins..") log.info("Registering global plug-ins..")
pyblish.register_plugin_path(PUBLISH_PATH) pyblish.register_plugin_path(PUBLISH_PATH)
pyblish.register_discovery_filter(filter_pyblish_plugins) pyblish.register_discovery_filter(filter_pyblish_plugins)