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 suppress console printing HTTP responses? #532

Closed
laubonghaudoi opened this issue Aug 31, 2023 · 2 comments
Closed

How to suppress console printing HTTP responses? #532

laubonghaudoi opened this issue Aug 31, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@laubonghaudoi
Copy link

Describe the bug
Whenever I call any function such as supabase.table("table").select("*").execute()and run my python script, the console prints every HTTP request and response, which messes up my script output, like this:

2023-08-30 16:18:05,897:INFO - HTTP Request: POST https://abcdefghijk.supabase.co/rest/v1/table "HTTP/1.1 201 Created"
2023-08-30 16:18:06,020:INFO - HTTP Request: POST https://abcdefghijk.supabase.co/rest/v1/table "HTTP/1.1 201 Created"
2023-08-30 16:18:06,125:INFO - HTTP Request: POST https://abcdefghijk.supabase.co/rest/v1/table "HTTP/1.1 201 Created"
2023-08-30 16:18:06,244:INFO - HTTP Request: POST https://abcdefghijk.supabase.co/rest/v1/table "HTTP/1.1 201 Created"
2023-08-30 16:18:06,344:INFO - HTTP Request: POST https://abcdefghijk.supabase.co/rest/v1/table "HTTP/1.1 201 Created"
2023-08-30 16:18:06,445:INFO - HTTP Request: POST https://abcdefghijk.supabase.co/rest/v1/table "HTTP/1.1 201 Created"
2023-08-30 16:18:06,570:INFO - HTTP Request: POST https://abcdefghijk.supabase.co/rest/v1/table "HTTP/1.1 201 Created"
2023-08-30 16:18:06,718:INFO - HTTP Request: POST https://abcdefghijk.supabase.co/rest/v1/table "HTTP/1.1 201 Created"
2023-08-30 16:18:06,950:INFO - HTTP Request: POST https://abcdefghijk.supabase.co/rest/v1/table "HTTP/1.1 201 Created"
2023-08-30 16:18:07,066:INFO - HTTP Request: POST https://abcdefghijk.supabase.co/rest/v1/table "HTTP/1.1 201 Created"
2023-08-30 16:18:07,202:INFO - HTTP Request: POST https://abcdefghijk.supabase.co/rest/v1/table "HTTP/1.1 201 Created"
2023-08-30 16:18:07,335:INFO - HTTP Request: POST https://abcdefghijk.supabase.co/rest/v1/table "HTTP/1.1 201 Created"
2023-08-30 16:18:07,459:INFO - HTTP Request: POST https://abcdefghijk.supabase.co/rest/v1/table "HTTP/1.1 201 Created"
2023-08-30 16:18:07,557:INFO - HTTP Request: POST https://abcdefghijk.supabase.co/rest/v1/table "HTTP/1.1 201 Created"
2023-08-30 16:18:07,692:INFO - HTTP Request: POST https://abcdefghijk.supabase.co/rest/v1/table "HTTP/1.1 201 Created"
2023-08-30 16:18:07,857:INFO - HTTP Request: POST https://abcdefghijk.supabase.co/rest/v1/table "HTTP/1.1 201 Created"
2023-08-30 16:18:07,973:INFO - HTTP Request: POST https://abcdefghijk.supabase.co/rest/v1/table "HTTP/1.1 201 Created"

This behavior occurs after I upgraded supabase-py to the latest version. I don't think the old versions have this issue.

To Reproduce
Call supabase.table("table").select("*").execute() in a jupyter notebook or run it in a python script.

Expected behavior
I don't remember which version but previously the console did not output HTTP responses. I want to get rid of these printed lines and make it print only when I explicitly ask to.

Screenshots
image

@cutlope
Copy link

cutlope commented Sep 5, 2023

This worked for me.

import logging

...

logging.getLogger("httpx").setLevel(logging.WARNING)

Here are the levels if you want to set a different level than above, but that was enough to get rid of the HTTP logs for me

@akherlan
Copy link

This answer from other issue might also help to consider logging setup on your script: #303 (comment)

@J0 J0 added the documentation Improvements or additions to documentation label Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

5 participants