Merge pull request #1512 from pypeclub/feature/convert_pyblish_logs_to_string

Convert pyblish logs to string at the moment of logging
This commit is contained in:
Milan Kolar 2021-05-17 13:29:29 +02:00 committed by GitHub
commit f87b580ad6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,6 +67,15 @@ def patched_discover(superclass):
@import_wrapper
def install():
"""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..")
pyblish.register_plugin_path(PUBLISH_PATH)
pyblish.register_discovery_filter(filter_pyblish_plugins)