Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kevinp2 opened this issue Apr 13, 2024 · 1 comment
Open

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

kevinp2 opened this issue Apr 13, 2024 · 1 comment
Labels

Comments

@kevinp2
Copy link

kevinp2 commented Apr 13, 2024

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
Copy link
Author

kevinp2 commented Apr 13, 2024

Update: this code seems to work for me. In the calling application, after obtaining the connection to the API:

requests_log = logging.getLogger("urllib3")
requests_log.setLevel ( "INFO" ) # Can be any of the log levels

Leaving this request open in case there is a better way to do this, or if it is desirable to add this kind of loglevel management to krakenex.

@veox veox added the bug label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants