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
Enable logging for python dependencies, particularly comtypes #10393
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This is not in alpha yet. |
Ok but something has upset my system in the last update then.
Brian
bglists@blueyonder.co.uk
Sent via blueyonder.
Please address personal E-mail to:-
briang1@blueyonder.co.uk, putting 'Brian Gaff'
in the display name field.
Newsgroup monitored: alt.comp.blind-users
-----
|
michaelDCurran
approved these changes
Oct 21, 2019
This already proves to be helpful. When I open the Emoji panel in Windows 20:1 insider preview, i"m getting unhandled exceptions by our UIA event handler. I was already investing some resources in increasing UIA logging, so I fixed this in #10397 hopefully. |
Here is an example traceback:
In my opinion, we should catch these in NVDA |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Link to issue number:
Related to #10247
Comtypes issue enthought/comtypes#192
Summary of the issue:
Some of our dependencies, particularly comtypes, have built in logging. However, logging data from these dependencies is ignored, as the NVDA logfile handler is set on the NVDA logger, not on the root logger of all loggers.
Description of how this pull request fixes the issue:
This pr registers our logHandler to the root logger. This means that python modules that use python's logging facility (not the NVDA specific one) are still able to log their information to the NVDA log.
The NVDA log level is also applied to the root logger, but only if it is warning or higher. This is because warnings or errors logged by dependencies like comtypes are certainly very interesting to know, though we want to avoid comtypes debug information leaking into our log when our log level is debug.
Testing performed:
Tested that comtypes.logger.error logs its data to the NVDA log and plays the NVDA error sound.
Known issues with pull request:
I initially started with a comtypes specific implementation that registered our log handler to the comtypes logger and was also able to log comtypes output at level debug. However, having comtypes log at the debug level is very verbose and, more importantly, can cause serious issues as some of its logging is re-entrant. Long story short, comtypes debug logging is not what we want.
Here is an example traceback generated when comtypes logging is set to debug. Strange enough, even though that traceback was sent to stderr, it didn't pop up in the log. I had to manually monkeypatch stderr to a text file in order for the traceback to be retrieved.
Change log entry: