Add restart with debug level logging #6721

Merged
merged 4 commits into from Jan 31, 2017

Projects

None yet

3 participants

@feerrenrut
Contributor

See issue #6689
This provides a convenience to users who wish to enable debug level logging temporarily (one run of nvda).
A start up option is added to make it easier to start nvda with debug level logging. Enabling debug logging in this way sets the log level earlier than setting it via the configuration file. In particular, this allows the debug messages that occur during the loading of the configuration file to be present in the log file.

@feerrenrut feerrenrut Add restart with debug level logging
See issue #6689
This provides a convenience to users who wish to enable debug level
logging temporarily (one run of nvda).
A start up option is added to make it easier to start nvda with debug
level logging. Enabling debug logging in this way sets the log level
earlier than setting it via the configuration file. In particular, this
allows the debug messages that occur during the loading of the
configuration file to be present in the log file.
6af0932
@feerrenrut feerrenrut requested a review from jcsteh Jan 12, 2017
readme.md
@@ -124,7 +124,7 @@ By default, builds also do not use any compiler optimizations.
Please see the release keyword argument for what compiler optimizations it will enable.
## Running the Source Code
-To start NVDA from source code, run `nvda.pyw` located in the source directory.
+To start NVDA from source code, run `nvda.pyw` located in the source directory. To view help on the arguments that nvda will accept use the `-h` or `--help` option. These arguments are also documented in the user guide. Since nvda is a Windows application (rather than command line) it is best to run it with `pythonw.exe`. However, if during development you encounter an error early in the startup of nvda you can use `python.exe` which is likely to give more information about the error.
@jcsteh
jcsteh Jan 19, 2017 Contributor
  1. Please split each sentence onto its own line.
  2. Comma after "will accept", "command line)" and "startup of nvda".
  3. "startup of nvda": NVDA in all caps.
source/core.py
@@ -81,6 +81,8 @@ def restart(disableAddons=False):
pass
if disableAddons:
options.append('--disable-addons')
+ if debugLogging:
+ options.append('--debug-logging')
@jcsteh
jcsteh Jan 19, 2017 Contributor

Consider the following scenario:

  1. User chooses to restart with debug logging.
  2. User then restarts again normally (no debug logging).

In step 2, sys.argv will contain --debug-logging, but it isn't removed. Unless I'm missing something, that means debug logging will still be enabled on the second (normal) restart.

In contrast, --disable-addons is explicitly removed from sys.argv just before this, which prevents it from being propagated into a normal restart.

@jcsteh
jcsteh approved these changes Jan 19, 2017 View changes

Good to incubate barring the one nit below.

readme.md
-To start NVDA from source code, run `nvda.pyw` located in the source directory. To view help on the arguments that nvda will accept use the `-h` or `--help` option. These arguments are also documented in the user guide. Since nvda is a Windows application (rather than command line) it is best to run it with `pythonw.exe`. However, if during development you encounter an error early in the startup of nvda you can use `python.exe` which is likely to give more information about the error.
+To start NVDA from source code, run `nvda.pyw` located in the source directory.
+To view help on the arguments that NVDA will accept, use the `-h` or `--help` option.
+These arguments are also documented in the user guide. Since NVDA is a Windows application (rather than command line), it is best to run it with `pythonw.exe`.
@jcsteh
jcsteh Jan 19, 2017 Contributor

Two sentences on this line. :)

@feerrenrut feerrenrut added a commit that referenced this pull request Jan 19, 2017
@feerrenrut feerrenrut incubates #6721
Re issue #6689
Merge branch 'i6689-restartWithDebugLogging' into next
64f7053
@feerrenrut feerrenrut merged commit a2ac3da into master Jan 31, 2017
@nvaccessAuto nvaccessAuto added this to the 2017.1 milestone Jan 31, 2017
@feerrenrut feerrenrut added a commit that referenced this pull request Jan 31, 2017
@feerrenrut feerrenrut Update changes file for PR #6721
- Added an option to the exit dialog to restart with debug level logging. (Issue #6689)
a61bf36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment