Skip to content

General Settings GUI: Disable log level drop-down when log level is disabled or forced (#10209)#10258

Merged
michaelDCurran merged 4 commits into
nvaccess:masterfrom
accessolutions:i10209-disabledLoggingGUI
Sep 23, 2019
Merged

General Settings GUI: Disable log level drop-down when log level is disabled or forced (#10209)#10258
michaelDCurran merged 4 commits into
nvaccess:masterfrom
accessolutions:i10209-disabledLoggingGUI

Conversation

@JulienCochuyt

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #10209

Summary of the issue:

When logging is disabled - either because of secure mode or command line parameters - or when the log level is forced from the command line, the log level drop-down in the General Settings panel can still be operated.
It even shows "info" as the currently selected level while in secure mode.
In these conditions, the apparently possible change only impacts configuration: It does not effectively change the current log level of the running instance of NVDA.

As stated in #10209 (comment) @Qchristensen had contact from one IT administrator trying to setup NVDA securely on their system, concerned that although they have disabled logging, this drop-down can be changed, which gives the appearance that the log level can be changed.

Description of how this pull request fixes the issue:

  • Disable the drop-down when logging is disabled or the log level is forced from the command line.
  • Ensure that in secure mode the disabled drop-down shows "disabled" instead of "info".

Testing performed:

Ran a source copy with --no-logging / --debug-logging / --log-level / --secure / no parameter and checked the state and value of the drop-down.

Known issues with pull request:

Change log entry:

Section: Changes
The settings dialog no longer allows for changing the configured log level if it has been overridden from the command line.

Section: Bug fixes
The settings dialog no longer shows "info" as the current log level when in secure mode.

Comment thread source/gui/settingsDialogs.py Outdated
Comment thread source/logHandler.py
pass # Probably log does not exist, don't care.
logHandler = FileHandler(globalVars.appArgs.logFileName, mode="w",encoding="utf-8")
logLevel = globalVars.appArgs.logLevel
if globalVars.appArgs.debugLogging:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't there be a clause here that checks globalVars.appArgs.noLogging and sets the level to log.OFF?

@JulienCochuyt JulienCochuyt Sep 21, 2019

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, globalVars.appArgs.noLogging does not apply in the else clause we are in.

As a reminder:

  • --debug-logging takes precedence over --secure, --log-level and --no-logging
  • --log-level takes precedence over --secure and --no-logging

I am not sure about the motivations behind the historical decision of not making --debug-logging, --log-level and --no-logging mutually exclusive, though.

Co-Authored-By: Leonard de Ruijter <leonardder@users.noreply.github.com>
Comment thread source/gui/settingsDialogs.py Outdated
Comment thread source/logHandler.py Outdated
@michaelDCurran michaelDCurran merged commit 5264fed into nvaccess:master Sep 23, 2019
@nvaccessAuto nvaccessAuto added this to the 2019.3 milestone Sep 23, 2019
michaelDCurran added a commit that referenced this pull request Sep 23, 2019
@JulienCochuyt JulienCochuyt deleted the i10209-disabledLoggingGUI branch September 23, 2019 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When logging is disabled via command line, log level drop down should be greyed out

4 participants