fix: use module logger instead of root logger in exceptions.py#702
fix: use module logger instead of root logger in exceptions.py#702Bahtya wants to merge 2 commits intoinfluxdata:masterfrom
Conversation
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.
|
Hi team, just wanted to follow up on this PR. Would appreciate any feedback! |
Hi @Bahtya |
karel-rehor
left a comment
There was a problem hiding this comment.
@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 |
There was a problem hiding this comment.
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.
Problem
Fixes #701
In
client/exceptions.py,_get_message()useslogging.debug()which logs to the root logger instead of the module-level loggerinfluxdb_client.client.exceptionsdefined 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()Testing
logger = logging.getLogger("influxdb_client.client.exceptions")on line 7