Skip to content

Commit 0ffffc9

Browse files
committed
Use logger instead of logging
1 parent 387decf commit 0ffffc9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

oauth2cli/oauth2.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def __init__(
4545
self.client_secret = client_secret
4646
self.default_body = default_body or {}
4747
self.configuration = configuration or {}
48+
self.logger = logging.getLogger(__name__)
4849

4950
def _build_auth_request_params(self, response_type, **kwargs):
5051
# response_type is a string defined in
@@ -99,7 +100,8 @@ def _obtain_token( # The verb "obtain" is influenced by OAUTH2 RFC 6749
99100
# so we simply return it here, without needing to invent an exception.
100101
return resp.json()
101102
except ValueError:
102-
logging.exception("Token response is not in json format")
103+
self.logger.exception(
104+
"Token response is not in json format: %s", resp.text)
103105
raise
104106

105107
def obtain_token_with_refresh_token(self, refresh_token, scope=None, **kwargs):

0 commit comments

Comments
 (0)