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.
@Bahtya
Copy link
Copy Markdown
Author

Bahtya commented Apr 11, 2026

Hi team, just wanted to follow up on this PR. Would appreciate any feedback!

@NguyenHoangSon96
Copy link
Copy Markdown
Contributor

Hi team, just wanted to follow up on this PR. Would appreciate any feedback!

Hi @Bahtya
Can you rebase with the latest master, some errors will disappear and we can review it.

Copy link
Copy Markdown
Contributor

@karel-rehor karel-rehor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Bahtya Hi Bahtya. Thank your for your contribution.

I have one question about the proposed change to the onboarding script, which is working fine for a long time now.

Also a rebase is required. Changes to the pandas libraries, which are causing some tests to fail, have been addressed in #704, which has just been merged.


echo "Wait to start InfluxDB 2.0"
wget -S --spider --tries=20 --retry-connrefused --waitretry=5 http://localhost:8086/metrics
for i in $(seq 1 20); do
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why the simpler and cleaner wget one-liner needs to be replaced. Ideally PRs should not introduce extra complexity if it is not needed.

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?

3 participants