OpenPype icon indicating copy to clipboard operation
OpenPype copied to clipboard

Publish: Allow to disable printing logs to host

Open BigRoy opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

I'd like to disable Pyblish (and potentially even OpenPype Logger logs during publishing) printing its logs into the Host DCC (e.g. Maya) as a setting when running the Pyblish UI.

Describe the solution you'd like

Be able to set e.g. a OPENPYPE_PRINT_PYBLISH_LOGS=0 or an equivalent setting to disable the printing to stderr. The logs should still get collected and handled by the UI. I'd only like to have it not propagate its logs into the host DCC.

Describe alternatives you've considered

I've tried disabling the propagating of the Pyblish loggers like this:

import logging

log = logging.getLogger("pyblish")
log.propagate = False

But that also avoids the Pyblish Pype UI to actually capture the logs. Note that the original Pyblish QML does work with propagate disabled - there the logs still get handled by the UI regardless.

Additional context

Printing in the Maya script editor has always been relatively slow - and during publishing there's relatively quite a high amount of logging/printing being done. I'd like to try and avoid the clutter in the Script Editor and at the same time likely optimize the publishing steps too.

Especially with the new publisher UI coming up the logs are much easier to debug per instance in the UI - better than the printed logs into the host DCC would allow for debugging.

First mentioned on OpenPype discord here


Of course would also love to know if this is a bad idea to begin with. :)

[cuID:2u0r29k]

BigRoy avatar Sep 07 '22 08:09 BigRoy

It would be great if we could set logging level for Pyblish plugins.

kalisp avatar Sep 08 '22 10:09 kalisp