-
-
Notifications
You must be signed in to change notification settings - Fork 627
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
Use only supported log levels for command line option #14406
Conversation
I'm somehow missing the logging category from NVDA"s general settings. Could this pr be related? |
Could you elaborate? When you run nvda with the |
Sure. When launching NVDA from my desktop shortcut, logHandler.isLogLevelForced() returns True. shortcut is: |
'--log-level', | ||
dest='logLevel', | ||
type=int, | ||
default=20, |
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 line breaks it for me.
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.
OK. I can see the issue, thanks. I will fix it.
In addition, I just realize that in this PR, I have not updated the user guide command line option. Moreover, I have now come across this comment in and more generally the discussion in #8596. It seems that there were (for NVDA 2022.4beta3 and before) many log levels and only a subset of them were accessible from the GUI, as explained by @josephsl . Thus we have two solutions: Solution 1: Fix-up this PRFix the issue with log level combo-box not usable anymore in the GUI: the default value in the parser is to be restored to 0. We would end-up with the following command-line log levels being removed: 30 (= WARNING), 40 (= ERROR), 50 (= CRITICAL). Since INFO is not so much verbose, are there really persons using the Note: DEBUGWARNING (12) remains available and is not to be confused with WARNING (30). Solution 2: Revert this PROn the opposite, we may revert this PR. On the contrary to what I have written in the description of this PR, levels 30, 40, 50 seem to work correctly and NVDA does not log INFO messages at these levels. There would be some fixes to do in the future however:
ConclusionBefore doing anything, I would like to hear NVAccess point of view (@seanbudd, @feerrenrut) as well as other members of the community (@josephsl, @LeonarddeR) |
This reverts commit 279643e.
@michaelDCurran it is unclear which solution from #14406 (comment) NVAccess would like. Solution 1 was fully implemented by #14406 + #14432. But you have reverted #14406 and closed #14432, which would let think that you prefer solution 2. But on the other side you write:
That let me think that you agree with solution 1. So, could you then react to #14406 (comment) and indicate clearly what you are expecting? In other words, would you like WARNING, ERROR and CRITICAL to be available as NVDA log level or removed? And if you want to keep it, should these levels be available only with command line (as today) or also in the GUI? Thanks. |
Firstly, reverting the pr should not be seen as a statement on which solution I liked. NV Access's policy is to revert a pr if it directly causes an issue and a release containing the pr has not yet been made. What I wrote about making a new pr possibly incorporating #14406 and #14432 was more a general statement saying that there was a problem. We reverted. Please try again in a new pr. Sorry if I did not word this well. |
nvaccess#14406)" (nvaccess#14442)" This reverts commit 324f6e5.
#14444) When starting NVDA with an unsupported command line parameter, you get the following suggestion for log level in the error message: [-l {10,12,15,20,30,40,50,100}] Launching NVDA with log level set to 30, 40 or 50 leads to undesirable behaviours: • an empty value in the log level combo-box in NVDA's general settings. • NVDA+F1 does not open the log • NVAccess does not want log level WARNING, ERROR or CRITICAL as written by @michaelDCurran in Use only supported log levels for command line option #14406 (comment): We don't ever want users providing logs to us at level warning, error or critical as they are simply not useful as they drop too much information and therefore just waste time for the user and us. Also, the description of the -l option is erroneous in the user guide and in the help text for command line since it indicates that the default value for this option is WARNING. Instead, the default behaviour (i.e. when the option is not specified) is to follow what comes from NVDA config; and if there is nothing in the user's config, the default config spec specifies that the log level is INFO. Description of user facing changes • Only supported log levels are indicated in the error message when a wrong parameter is passed to NVDA. • Only supported log level can now be used from command line, i.e. 10=debug, 12=I/O, 15=debugWarning, 20=info and 100=off • The description of the -l option is updated in the user guide and in the help text for command line Description of development approach • Changed the information passed to the command line parser. • Updated the available log levels in the user guide and the command line help; also removed the indication related to "default" since it was just adding confusion. For more clarity I may have rewritten the option description in command line help and in the user guide to something like "Forces the log level". I have not done this since it is not done for other options such as -c, --log-file, etc.
Context: issue found while reading the code for #14398.
Link to issue number:
None
Summary of the issue:
When starting NVDA with an unsupported command line parameter, you get the following suggestion for log level in the error message:
Launching NVDA with log level set to 30, 40 or 50 actually indicates NVDA using info level.
Description of user facing changes
Description of development approach
--lang
parameter; this seem to have no impact however since "Windows" was already used when this parameter is missing.Testing strategy:
Manual tests:
-l
parameter is not passed to NVDA-l
command line param set to 10, 12, 15, 20 and 100 and the appropriate log level is used-l
set to 30, 40, 50 and 99.Note: also tested
--lang=windows
; this fails but it was already failing before this PR, e.g. in NVDA 2022.4beta3. I will open an issue for that.Known issues with pull request:
None
Change log entries:
Probably not needed.
Or maybe something in the bugfixes category? What do you think?
Code Review Checklist: