-
Notifications
You must be signed in to change notification settings - Fork 36
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
Publisher: Do not log to console #877
Publisher: Do not log to console #877
Conversation
It did actually, it captured all output. I think it was just getting everything from the root logger. Is there any way we can set the logger just on start and end of the publish iterator instead of per plug-in? We could have a constant on the UI controller like: control_loggers = {"pyblish"} So that we can just do on publisher UI start: for name in control_loggers:
logger = logging.getLogger(name)
logger.propagate = False
logger.addHandler(ui_handler)
# Add root handler
logging.getLogger().addHandler(ui_handler) And then when the publishing UI stops we do: for name in control_loggers:
logger = logging.getLogger(name)
logger.propagate = True
logger.removeHandler(ui_handler)
# Remove root handler
logging.getLogger().removeHandler(ui_handler) That would also make it much easier to expand it to capturing more logs explicitly, like It would be extra awesome if somehow we could ALSO capture the output of "resetting" the publisher so that e.g. this:
Would become part of the UI logs as well. |
Yep, isn't that better? 🙂
Technically yes, but it would be much harder to maintain it. It could start capture logs out of publishing logic unrelated to publish plugins.
That happens out of publish plugins. In other words, outof scope of this PR as that is feature request. |
I think this breaks publishing in Maya:
|
Should be fixed. |
Now the question is how to allow to enable/disable logging to console. From my point of view logging from plugins to console should be disabled by default in publisher UI, but for development it might be helpful to have it enabled. Suggestion: Add settings button to top right of publisher window with menu and actions? That could be also place for debuger tool. With that it is kinda hidden from artists and does not require restart of DCC to change behavior. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works on my side. publishing is much faster now.
Now the question is how to allow to enable/disable logging to console.
IMO, we can jsut depend on an environment variable that users/developers can set in their session.
I agree, a documented environment variable should suffice for now. |
…console # Conflicts: # client/ayon_core/tools/publisher/models/publish.py
Crap, I've merged it... NOTE: |
I'd say somewhere in
|
This is awesome. Let's create a GH issue for it so that we don't forget about it, and I'm going to pick it up as as I get my hands free. |
Changelog Description
Preflight PR to disable logging to console in Publish UI.
Additional info
Disable propagation of pyblish plugin logs to root logger handlers. Add custom logging handler that is added to plugin logger and to root logger for process time, which is remove afterwards.
With current modifications it also captures all logs in root logger, not sure if that happened before too, but I like it.
Question
How to give option to change the behavior now? Some settings checkbox?
Testing notes:
Resolves #740