Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish: Allow to disable printing logs to host #740

Closed
BigRoy opened this issue Sep 7, 2022 · 4 comments · Fixed by #877
Closed

Publish: Allow to disable printing logs to host #740

BigRoy opened this issue Sep 7, 2022 · 4 comments · Fixed by #877
Labels
community Issues and PRs coming from the community members type: enhancement Improvement of existing functionality or minor addition

Comments

@BigRoy
Copy link
Collaborator

BigRoy commented Sep 7, 2022

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:OP-3914]

@kalisp
Copy link
Member

kalisp commented Sep 8, 2022

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

@BigRoy
Copy link
Collaborator Author

BigRoy commented Apr 3, 2023

Just wanted to chime in that this is very relevant for Substance Painter too. I had a case where a single self.log.info("TEST") took about 0.2 seconds if Substance's Painter logs were already quite full. Clearing the Substance Painter logs sped it up again. But that likely means not filling up its logs will be beneficial too.

As an example:

class ExampleFast(pyblish.api.InstancePlugin):
    order = pyblish.api.CollectorOrder + 0.4

    def process(self, instance):
        return

class ExampleSlow(pyblish.api.InstancePlugin):
    order = pyblish.api.CollectorOrder + 0.4

    def process(self, instance):
        self.log.info("TEST")

The fast example here would run over 30 instances pretty much instantly, the second would then take about 0.2seconds per instance if Substance Painter has a lot of previous logs still in its logs (even if the log view is disabled).

@BigRoy
Copy link
Collaborator Author

BigRoy commented Apr 5, 2023

Also wanted to link this PR #817 to additionally explain how much impact logging can have on performance. Note however that if printing to the host UI isn't done it still wouldn't remove the full issue of actually still formatting and logging massive data sets as described in that issue, but it'll definitely help in some DCCs.

@MustafaJafar MustafaJafar added community Issues and PRs coming from the community members type: enhancement Improvement of existing functionality or minor addition labels Jul 7, 2023
@BigRoy BigRoy transferred this issue from ynput/OpenPype Jul 3, 2024
@BigRoy
Copy link
Collaborator Author

BigRoy commented Jul 3, 2024

This issue coming from OpenPype is still relevant to AYON since I've still noticed slowness on the printing of logs to the host - so I transferred the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Issues and PRs coming from the community members type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants