Skip to content

Added a specific log channel for nvwave debug message#11582

Merged
feerrenrut merged 4 commits into
nvaccess:betafrom
CyrilleB79:nvwaveLog
Sep 10, 2020
Merged

Added a specific log channel for nvwave debug message#11582
feerrenrut merged 4 commits into
nvaccess:betafrom
CyrilleB79:nvwaveLog

Conversation

@CyrilleB79

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #11574

Summary of the issue:

After the merge of #11531, some extra debug messages have been added in the log. They are quite specific and make the log quite noisy while debugging something else.
Since they are used for a well specific purpose and to ease the debug tasks, it was suggested and approved in #11574 (comment) that they appear under a dedicated log flag.

Description of how this pull request fixes the issue:

  • Added a new "nvwave" item in the "Enabled logging categories" list of the "Advanced" setting panel. This allow to log nvwave utility messages only if this item is checked.
  • This item is unchecked by default
  • All the logger calls in the nwave.py have been put under "nvwave" log flag, unless the following ones:
    • log.warning(f"Unable to open WAVE_MAPPER device, there may be no audio devices.")
    • log.warning("Error during feed. Resetting the device.")
    • log.debugWarning("Unable to send data to audio device on second attempt.", exc_info=True)
    • log.exception("Error calling onDone")
  • I have filtered the following log.debug call but I have a doubt on it:
log.debug(
	f"Error opening"
	f" outputDeviceName: {self._outputDeviceName}"
	f" with id: {self._outputDeviceID}"
)```

Testing performed:

  • Set log level to debug
  • Checked that some of the messages under this log channel are logged if "nvwave" log is enabled and that they are not logged if it is disabled.

Known issues with pull request:

None.

Change log entry:

No need to specify the corresponding issue (#11574) since this issue was only seen on alpha.
Is there a need to indicate this log channel in the Changes for developers section? Such other log channels are not specified in the change log.

The majority of the message logged in nvwave.py is disabled by default.
To enable it, check the nvwave item in the "Enabled logging categories" list of the "Advanced" setting panel.
@CyrilleB79

Copy link
Copy Markdown
Contributor Author

@feerrenrut, may you review this one?

Could you specifically look at the following points (among other):

  • I have set "nvwave" as the name of this log category. Is it adapted and self-explaining enough?
  • I have excluded some messages from this flag, i.e. they are logged even if "nvwave" item is not checked, because they seemd more important to me. Could you check this?

I have no experience of this part of code so let me know your feedback on these two points as well as on this PR more generally.

I have targeted beta branch as you told me.
I do not know how much time these nvwave messages should remain in the general log.debug. Maybe a little time with more users/testers in the beta before merging it? It's up to you!

@AppVeyorBot

This comment has been minimized.

@feerrenrut feerrenrut left a comment

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.

Generally looks good, thanks @CyrilleB79

Comment thread source/nvwave.py Outdated
CyrilleB79 and others added 2 commits September 9, 2020 22:40
Co-authored-by: Reef Turner <feerrenrut@users.noreply.github.com>

@feerrenrut feerrenrut left a comment

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.

Thanks @CyrilleB79

@feerrenrut feerrenrut merged commit 7896e88 into nvaccess:beta Sep 10, 2020
@nvaccessAuto nvaccessAuto added this to the 2020.4 milestone Sep 10, 2020
@feerrenrut feerrenrut modified the milestones: 2020.4, 2020.3 Sep 10, 2020
@CyrilleB79

Copy link
Copy Markdown
Contributor Author

I have written the following line in this PR's description:

Fixes #11574

However, #11574 does not appear linked to this PR, nor closed. Why?
I may close the issue by myself, but I would be interested to know why it did not link automatically...

@lukaszgo1

Copy link
Copy Markdown
Contributor

@CyrilleB79 wrote:

I have written the following line in this PR's description:

Fixes #11574

However, #11574 does not appear linked to this PR, nor closed. Why?
I may close the issue by myself, but I would be interested to know why it did not link automatically...

GitHub closes issues automatically only when the corresponding PR is opened against main branch of the repository - in this case against master. Since this one targets beta #11574 will be closed after beta containing commit from this PR would be merged to master.

@CyrilleB79

Copy link
Copy Markdown
Contributor Author

@lukaszgo1 thanks for the answer.

However in #11574, I can read:

Linked pull requests
Successfully merging a pull request may close this issue.
None yet

I would have expected the PR to be linked to the issue, even if the issue is not yet closed (since not yet merged into master branch).

@lukaszgo1

Copy link
Copy Markdown
Contributor

@CyrilleB79 wrote:

@lukaszgo1 thanks for the answer.

However in #11574, I can read:

Linked pull requests
Successfully merging a pull request may close this issue.
None yet

I would have expected the PR to be linked to the issue, even if the issue is not yet closed (since not yet merged into master branch).

That is quite strange indeed. I have no idea why this is happening. It would be interesting what happens after beta is merged to master.

@CyrilleB79

Copy link
Copy Markdown
Contributor Author

Oops, it seems that I have forgotten one instance of log.debug.

def _close(self):
		log.debug("Calling winmm.waveOutClose")

Should I make a PR against beta or master?

On the contrary, as stated in the description of this PR, the following log was left intentionally since it corresponds to an error:

log.debug("Error closing the device, it may have been removed.", exc_info=True)

@feerrenrut

Copy link
Copy Markdown
Contributor

This can be made against beta. Thanks @CyrilleB79

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.

5 participants