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

Verbose notification logging on bluezdbus client with characteristic notifications #258

Closed
Matt-Hicks-Bose opened this issue Jul 16, 2020 · 1 comment · Fixed by #279
Closed
Assignees
Labels
Backend: BlueZ Issues and PRs relating to the BlueZ backend enhancement New feature or request
Milestone

Comments

@Matt-Hicks-Bose
Copy link

  • bleak version: 0.7.1
  • Python version: 3.7.3
  • Operating System: Linux
  • BlueZ version (bluetoothctl -v) in case of Linux: 5.50

Description

The bleak bluezdbus backend client emits a logging message at both the logging.DEBUG and logging.INFO level every time a characteristic notification is received. This behavior is different than the corebluetooth and dotnet backends which do not log on every notification. This is causing my application to emit several hundred logging messages per second at the logging.INFO level, rendering the logging extremely verbose and not very useful. I am currently changing the logging level of bleak.backends.bluezdbus.client to logging.WARNING, which unfortunately also suppresses some messages that I would like to keep.

I believe that the bluezdbus client should behave the same way as the other two backends and not emit a logging message on characteristic notification.

See BleakClientBlueZDBus._properties_changed_callback():
The logging.DEBUG message https://github.com/hbldh/bleak/blob/master/bleak/backends/bluezdbus/client.py#L777
The logging.INFO message https://github.com/hbldh/bleak/blob/master/bleak/backends/bluezdbus/client.py#L785

What I Did

Connect to a BLE device under Linux and enable notifications on a characteristic that changes frequently.

@hbldh hbldh self-assigned this Jul 20, 2020
hbldh added a commit that referenced this issue Jul 20, 2020
@hbldh hbldh added Backend: BlueZ Issues and PRs relating to the BlueZ backend enhancement New feature or request labels Jul 20, 2020
@hbldh hbldh added this to the Version 0.8.0 milestone Jul 20, 2020
@hbldh
Copy link
Owner

hbldh commented Jul 20, 2020

I agree. I have not revisited the logging since I first used it for developing the package. Committed some changes now that will be present in upcoming 0.8.0 release.

@hbldh hbldh mentioned this issue Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend: BlueZ Issues and PRs relating to the BlueZ backend enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants