From 636f736765700ada5a077d02eb6629c5e18fc229 Mon Sep 17 00:00:00 2001 From: MattHag <16444067+MattHag@users.noreply.github.com> Date: Thu, 2 Jan 2025 14:16:25 +0100 Subject: [PATCH] solaar/cli: Remove outdated logger enabled checks Logger enabled checks clutter the code unnecessarily. The checks are now handled in a custom logger class. Eventually they can be completely removed in the future. Related #2664 --- lib/solaar/cli/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/solaar/cli/__init__.py b/lib/solaar/cli/__init__.py index 2f846955..5a4f83e8 100644 --- a/lib/solaar/cli/__init__.py +++ b/lib/solaar/cli/__init__.py @@ -116,8 +116,7 @@ def _receivers(dev_path=None): continue try: r = receiver.create_receiver(base, dev_info) - if logger.isEnabledFor(logging.DEBUG): - logger.debug("[%s] => %s", dev_info.path, r) + logger.debug("[%s] => %s", dev_info.path, r) if r: yield r except Exception as e: @@ -135,8 +134,7 @@ def _receivers_and_devices(dev_path=None): else: d = receiver.create_receiver(base, dev_info) - if logger.isEnabledFor(logging.DEBUG): - logger.debug("[%s] => %s", dev_info.path, d) + logger.debug("[%s] => %s", dev_info.path, d) if d is not None: yield d except Exception as e: