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

Fusion: OpenPype Logging Handler always logs red errors messages #5

Open
BigRoy opened this issue Feb 22, 2022 · 1 comment
Open

Fusion: OpenPype Logging Handler always logs red errors messages #5

BigRoy opened this issue Feb 22, 2022 · 1 comment
Labels
type: enhancement Improvement of existing functionality or minor addition

Comments

@BigRoy
Copy link
Collaborator

BigRoy commented Feb 22, 2022

Describe the bug

When OpenPype logs messages through its default logger from openpype.lib.log.PypeLogger it writes to sys.stderr due to the openpype.lib.log.PypeStreamHandler inheriting from logging.StreamHandler which defaults to writing to sys.stderr when no stream is provided.

unknown

For Fusion artists it's a bit confusing because the Console tab gets a red warning icon whenever any text is written through sys.stderr and thus it appears that even when just debug launching messages are printed as if things are going wrong.

afbeelding

Would it make sense to override this behavior for logging in Fusion for OpenPype. Preferably even before openpype.install() so that all messages are captured the right way. If so, where would I do that? Could an env variable be a solution to this.

Visually for Fusion the best bet would be to actually write to sys.stdout when info or debug level and write to sys.stderr when warning or higher. However, I'm not sure if that makes any sense in logging world.

To Reproduce

Steps to reproduce the behavior:

  1. Start any tool in Fusion
  2. Note how any logged message from the OpenPype logger logs as red error text

Additional context

Also reported on discord here.
There already is some logic in the Fusion integration to solve some of the logging coloring issues but they date from before OpenPype and thus the OpenPype logger. Also the solution in that install logic might not be the best approach either. So would love to have some input on how to best approach something like this.

[cuID:OP-6742]

@BigRoy BigRoy self-assigned this Feb 22, 2022
@BigRoy BigRoy removed their assignment Oct 18, 2023
@BigRoy BigRoy transferred this issue from ynput/OpenPype Jul 4, 2024
@BigRoy
Copy link
Collaborator Author

BigRoy commented Oct 7, 2024

This may be already much less problematic since recent changes where the Publisher UI does not print into the host integration's console: ynput/ayon-core#877

@BigRoy BigRoy added the type: enhancement Improvement of existing functionality or minor addition label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

No branches or pull requests

1 participant