This is an automated email from the ASF dual-hosted git repository.
jshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new 30d6543d9e [#7583] remove unused logger in python client (#7627)
30d6543d9e is described below
commit 30d6543d9e83621bf81282dc32fc412e6e9bb884
Author: Yunchi Pang <[email protected]>
AuthorDate: Thu Jul 10 20:11:58 2025 -0700
[#7583] remove unused logger in python client (#7627)
### What changes were proposed in this pull request?
Logging configuration moved to module level, handler added only once
when module is imported.
### Why are the changes needed?
The previous logger implementation in `http_client.py` creates a log
handler every time a `Response` object is instantiated, which may cause
log message duplication and consume unnecessary memory over time.
Fix: #7583
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existing tests for `client-python`.
---
clients/client-python/gravitino/utils/http_client.py | 8 --------
1 file changed, 8 deletions(-)
diff --git a/clients/client-python/gravitino/utils/http_client.py
b/clients/client-python/gravitino/utils/http_client.py
index 1e51b4ef62..a99b5bed0c 100644
--- a/clients/client-python/gravitino/utils/http_client.py
+++ b/clients/client-python/gravitino/utils/http_client.py
@@ -22,7 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE
SOFTWARE.
"""
-import logging
from typing import Tuple
from urllib.request import Request, build_opener
from urllib.parse import urlencode
@@ -41,8 +40,6 @@ from gravitino.dto.responses.oauth2_error_response import
OAuth2ErrorResponse
from gravitino.exceptions.base import RESTException, UnknownError
from gravitino.exceptions.handlers.error_handler import ErrorHandler
-logger = logging.getLogger(__name__)
-
class Response:
def __init__(self, response):
@@ -51,11 +48,6 @@ class Response:
self._headers = response.info()
self._url = response.url
- logging.basicConfig(level=logging.DEBUG)
- console_handler = logging.StreamHandler()
- console_handler.setLevel(logging.DEBUG)
- logger.addHandler(console_handler)
-
@property
def status_code(self):
return self._status_code