Skip to content

Logging: add an option to turn logging off altogether#8596

Merged
feerrenrut merged 19 commits into
nvaccess:masterfrom
josephsl:i8516noLogging
Dec 17, 2018
Merged

Logging: add an option to turn logging off altogether#8596
feerrenrut merged 19 commits into
nvaccess:masterfrom
josephsl:i8516noLogging

Conversation

@josephsl

@josephsl josephsl commented Aug 6, 2018

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #8516

Summary of the issue:

Add an option to turn off logging altogether.

Description of how this pull request fixes the issue:

Add a new option in General settings panel to turn off logging. If this option is chosen, only a startup message (along with config path) will be logged, and log level will be set to 100.

Testing performed:

Tested on source code with logging level set to off and other values.

Known issues with pull request:

Even with logging level set to off, startup info messages will be shown up to config path. Ideally this too should not be logged, but for now, it is acceptable.

Change log entry:

New features: It is possible to turn off NVDA's logging features off by setting logging level to "disabled" from General settings panel. (#8516)

Thanks.

…off logging functionality. re nvaccess#8516.

If NVDA is run with --no-logging, logging facility will be turned off altogether. This is handy for not only testing this feature, but also for those who'd like to add this command-line switch while defining nVDA shortcut on the desktop or add this from Run dialog (Windows+R).
Switch to null logger if no logging flag is turned on via command-line switches. Also, detect log level of 'OFF' and set log level accordingly (to 100).
… for secure mode. Re nvaccess#8516.

Describe available logging modes and what they mean. Also, when edscribing secure mode, add the fact that logging is turned off. Lastly, add an entry in command-line switches table for --no-logging switch.
@LeonarddeR

Copy link
Copy Markdown
Collaborator

Could you please use the closes or fixes keyword for the Link to issue number? In that case, github magic will automatically close the issue when the pr is merged.

@josephsl

josephsl commented Aug 6, 2018 via email

Copy link
Copy Markdown
Contributor Author

@Brian1Gaff

Brian1Gaff commented Aug 6, 2018 via email

Copy link
Copy Markdown

@DrSooom

DrSooom commented Aug 7, 2018

Copy link
Copy Markdown

Shall the default value set to "Info" (actual behaviour in NVDA Alpha 15781, 2018-08-03; General NVDA Settings window) or to "Disabled" (privacy by default)?

Furthermore there are two different nomenclature for the log levels in the User Guide.

Disabled, Info, Debug warning, Input/output Debug
| -l LOGLEVEL | --log-level=LOGLEVEL | The lowest level of message logged (debug 10, info 20, warning 30, error 40, critical 50, disabled 100), default is warning |

I'm a little bit confused.

@josephsl

josephsl commented Aug 7, 2018 via email

Copy link
Copy Markdown
Contributor Author

@DrSooom

DrSooom commented Aug 8, 2018

Copy link
Copy Markdown

I looked at the changed files in this PR directly via the GitHub website.

After merging there will be five log levels to be set up via the NVDA GUI and six via the command line. It would be nice to know which log level number have the five options which can be set via the GUI. Or as a question: What log level I have to choose in the command line to get the same result like with "Input/Output" via the GUI?

@josephsl

josephsl commented Aug 8, 2018 via email

Copy link
Copy Markdown
Contributor Author

@derekriemer derekriemer left a comment

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.

good. a few minor thoughts.

Comment thread source/nvda.pyw Outdated
Comment thread user_docs/en/userGuide.t2t
Comment thread user_docs/en/userGuide.t2t Outdated
Comment thread user_docs/en/userGuide.t2t Outdated
Comment thread user_docs/en/userGuide.t2t Outdated
Comment thread user_docs/en/userGuide.t2t
@josephsl

Copy link
Copy Markdown
Contributor Author

Hi,

Although I have no comments about nvda.pyw, I'll edit the user guide based on feedback. Thanks.

Add notes about privacy for I/O and debug logging levels, along with word usage changes.
@josephsl

Copy link
Copy Markdown
Contributor Author

Hi,

@feerrenrut, if you don't mind, I'd like to get a second look please. Thanks.

Comment thread source/logHandler.py Outdated
Comment thread source/nvda.pyw Outdated
Comment thread source/logHandler.py
Comment thread source/logHandler.py
Comment thread source/logHandler.py Outdated
Comment thread source/logHandler.py Outdated
# Input: kb(desktop):v
logFormatter=Formatter("%(levelname)s - %(codepath)s (%(asctime)s.%(msecs)03d):\n%(message)s", "%H:%M:%S")
if globalVars.appArgs.secure:
if globalVars.appArgs.secure or globalVars.appArgs.noLogging:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it should be possible to override this for debugging purposes. Perhaps either -l --log-level or --debug-logging could override this.

@feerrenrut

Copy link
Copy Markdown
Contributor

Happy to take this feature on, since it's already more or less done and gives users / admin more choices. But I think it's a mistake to think that this is a pathway to privacy or security. For admin trying to ensure that they with GDPR or similar requirements when providing a shared system there are much better ways to ensure the system is cleaned between users. For users who don't trust the system they are using, it should be assumed that every key press, everything displayed, and sound made is recorded. One use case that I think provides an actual benefit, is for uses with limited disk space (though I doubt many users with such limited disk space exist).

Changes made:
* log level checks: now a tuple will be checked.
* Allow users to override no logging and logging during secure mode via debug logging or predefined logging levels via command line switches. This means no log will be written if secure mode is active and/or no loggin is specified, and if no debug logging nor custom log levels are given.
Clarified:
* -l (log level): default is set to info, and added options for I/O and debugwarning.
* --debug-warning: add a notice that it can override --no-logging.
* --no-logging: add a notice that this can be overwritten with log levels from command line and if debug logging is on.
@feerrenrut feerrenrut merged commit 5e710da into nvaccess:master Dec 17, 2018
@nvaccessAuto nvaccessAuto added this to the 2018.4 milestone Dec 17, 2018
@codeofdusk

Copy link
Copy Markdown
Contributor

The changelog entry for this PR should probably be changed from:

New features: It is possible to turn off NVDA's logging features off by setting logging level to "disabled" from General settings panel. (#8516)

To:

New features: It is possible to turn off NVDA's logging features by setting the logging level to "disabled" from the General settings panel. (#8516)

@josephsl

josephsl commented Jan 13, 2019 via email

Copy link
Copy Markdown
Contributor Author

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.

Add the ability to completely disable NVDA's logging (including NVDA's crash dumps)

8 participants