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

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

Merged

Conversation

JulienCochuyt
Copy link
Collaborator

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.

source/gui/settingsDialogs.py Outdated Show resolved Hide resolved
@@ -317,6 +317,12 @@ def initialize(shouldDoRemoteLogging=False):
except (IOError, WindowsError):
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
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?

Copy link
Collaborator 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>
source/gui/settingsDialogs.py Outdated Show resolved Hide resolved
source/logHandler.py Outdated Show resolved Hide resolved
@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