Skip to content

Use of wrong logger in client/exceptions.py? #701

@nestorix1343

Description

@nestorix1343

Specifications

In client/exceptions.py, on line 37, an error is logged, but it uses:

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

I think it should be:

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

especially because on line 7, logger = logging.getLogger('influxdb_client.client.exceptions') is defined.

Now it appears to go to the root logger and that makes it somewhat difficult to control this message.

Code sample to reproduce problem

When the code hits this logging.debug line, it is difficult to contain in the program using this library.

Expected behavior

I would expect the logging to be send using the defined logger object (in line 7) instead of the root logger.

Actual behavior

The log is send to the root logger.

Additional info

No response

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions