Skip to content

Commit 8fdeca9

Browse files
committed
fix(security): address Bandit B110 in logging_utils by logging exceptions instead of pass
1 parent 1bed85b commit 8fdeca9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/common/logging_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ def configure_logging() -> int:
4646
if isinstance(cur, int) and cur != logging.NOTSET and cur > level:
4747
h.setLevel(level)
4848
except Exception:
49-
pass
49+
# Log at DEBUG to avoid noisy stderr while still providing diagnostics.
50+
logging.getLogger(__name__).debug(
51+
"Failed to adjust handler level for handler %r", h, exc_info=True
52+
)
5053

5154
# Only add our own stderr handler if there are NO handlers at all.
5255
# Many hosts (pytest, uv, VS Code) install a console handler already.

0 commit comments

Comments
 (0)