Skip to content

fix: use coloredlogs only for the bless package#182

Merged
kevincar merged 1 commit intokevincar:masterfrom
EasyRiderr:fix_log_issue
Feb 14, 2026
Merged

fix: use coloredlogs only for the bless package#182
kevincar merged 1 commit intokevincar:masterfrom
EasyRiderr:fix_log_issue

Conversation

@EasyRiderr
Copy link
Copy Markdown
Contributor

This fixes #181 by enabling the coloredlogs package only on bless and child modules.

Now, only bless logs are colored and there is no more issues when using bless and Kivy.

Test trace on Ubuntu:

TEST_HARDWARE=True python -m pytest -s
================================================================== test session starts ===================================================================
platform linux -- Python 3.12.3, pytest-9.0.2, pluggy-1.6.0
rootdir: /home/user/Documents/bless
configfile: pytest.ini
plugins: asyncio-1.3.0
asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function
collected 16 items / 2 skipped                                                                                                                           

test/backends/bluezdbus/test_application.py 
Please connect nowand subscribe to the characteristic d25fa9db-f680-4afb-9abb-2b2ee89134d9...
Press enter when ready...2026-02-10 16:50:49 user-laptop bless.backends.bluezdbus.dbus.characteristic[201902] DEBUG AcquireNotify on d25fa9db-f680-4afb-9abb-2b2ee89134d9 from 6A:7E:40:05:70:14 on FD 13
2026-02-10 16:50:49 user-laptop bless.backends.bluezdbus.dbus.characteristic[201902] DEBUG Closing RX

Trigger a read and enter the hex value you see below
Value: BEDDAD
Set the characteristic to the following: FADECAFE
Press enter when ready...
A new value will be sent
Press enter to receive the new value...
2026-02-10 16:51:36 user-laptop bless.backends.bluezdbus.dbus.characteristic[201902] DEBUG Sending update to 6A:7E:40:05:70:14
Enter the New value: FACEFADE
Unsubscribe from the characteristic
Press enter when ready...2026-02-10 16:51:44 user-laptop bless.backends.bluezdbus.dbus.characteristic[201902] DEBUG ReleaseNotify on d25fa9db-f680-4afb-9abb-2b2ee89134d9 from 6A:7E:40:05:70:14

.
test/backends/bluezdbus/test_utils.py .
test/backends/test_server.py ss
test/backends/test_server_multiclient.py s
test/test_bleak_v1_compatibility.py ..2026-02-10 16:51:45 user-laptop bless.backends.characteristic[201902] DEBUG With on_read: None
.2026-02-10 16:51:45 user-laptop bless.backends.characteristic[201902] DEBUG With on_read: None
..2026-02-10 16:51:45 user-laptop bless.backends.characteristic[201902] DEBUG With on_read: None
.2026-02-10 16:51:45 user-laptop bless.backends.characteristic[201902] DEBUG With on_read: None
.2026-02-10 16:51:45 user-laptop bless.backends.characteristic[201902] DEBUG With on_read: None
..2026-02-10 16:51:45 user-laptop bless.backends.characteristic[201902] DEBUG With on_read: None
2026-02-10 16:51:45 user-laptop bless.backends.characteristic[201902] DEBUG With on_read: None
.
test/test_init.py .

==================================================================== warnings summary ====================================================================
../../Downloads/env/bless/lib/python3.12/site-packages/_pytest/config/__init__.py:1428
  /home/user/Downloads/env/bless/lib/python3.12/site-packages/_pytest/config/__init__.py:1428: PytestConfigWarning: Unknown config option: timeout
  
    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

bless/backends/bluezdbus/dbus/session.py:28
  /home/user/Documents/bless/bless/backends/bluezdbus/dbus/session.py:28: DeprecationWarning: There is no current event loop
    loop: asyncio.AbstractEventLoop = asyncio.get_event_loop(),

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================== 13 passed, 5 skipped, 2 warnings in 71.04s (0:01:11) ==================================================

Signed-off-by: Yoan Dumas <yo_dumas@hotmail.fr>
@kevincar kevincar merged commit cd0ca15 into kevincar:master Feb 14, 2026
9 checks passed
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.

RecursionError: unable to import bless when a Kivy application is in use

2 participants