python3-krakenex icon indicating copy to clipboard operation
python3-krakenex copied to clipboard

How to turn off debug level in krakenex / requests module?

Open kevinp2 opened this issue 10 months ago • 1 comments

Versions

OS:  MacOS Catalina
Python: 3.10.12
krakenex: 2.2.1

What are you trying to achieve?

My app uses the python logging library and has the debug level set to INFO. But all krakenex calls results in DEBUG messages being written to the log. This clutters up the log.

2024-04-13 13:16:18 -0700 INFO: Exchange: Kraken
2024-04-13 13:17:40 -0700 DEBUG: Starting new HTTPS connection (1): api.kraken.com:443
2024-04-13 13:17:41 -0700 DEBUG: https://api.kraken.com:443 "GET /0/public/Time HTTP/1.1" 200 None

What do you expect to happen?

Calls to krakenex should not result in debug messages being written to the log unless desired by the calling application.

I believe that krakenex calls the requests module and the debug level is set there or further deeper. It would be acceptable to figure out a way for my app to somehow set the log level in the requests module. Ideally, krakenex should itself have a way to set the loglevel for all its calls.

All suggestions are appreciated.

kevinp2 avatar Apr 13 '24 20:04 kevinp2