Skip to content

fix: use module logger instead of root logger in exceptions.py#702

Open
Bahtya wants to merge 2 commits intoinfluxdata:masterfrom
Bahtya:fix/logger-instance
Open

fix: use module logger instead of root logger in exceptions.py#702
Bahtya wants to merge 2 commits intoinfluxdata:masterfrom
Bahtya:fix/logger-instance

Conversation

@Bahtya
Copy link
Copy Markdown

@Bahtya Bahtya commented Apr 8, 2026

Problem

Fixes #701

In client/exceptions.py, _get_message() uses logging.debug() which logs to the root logger instead of the module-level logger influxdb_client.client.exceptions defined on line 7.

This makes it difficult to control this log message through the standard logger hierarchy.

Fix

One-line change: logging.debug()logger.debug()

- logging.debug(f"Cannot parse error response to JSON: {response.data}, {e}")
+ logger.debug(f"Cannot parse error response to JSON: {response.data}, {e}")

Testing

  • No functional behavior change — only affects which logger namespace the message is emitted to
  • The module already defines logger = logging.getLogger("influxdb_client.client.exceptions") on line 7

Bahtya and others added 2 commits April 9, 2026 02:51
The logging.debug() call in _get_message() was using the root logger
instead of the module-level 'influxdb_client.client.exceptions' logger.
This made it impossible to control the log output via the configured
logger namespace.

Fixes influxdata#701

Signed-off-by: bahtya <bahtyar153@qq.com>
The cimg/python Docker images for Python 3.9+ are now based on
Ubuntu 24.04, which no longer includes wget by default. This caused
CI test failures on Python 3.9, 3.10, 3.11, and 3.12. Replace the
wget health check with an equivalent curl-based retry loop.
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.

Use of wrong logger in client/exceptions.py?

1 participant