9
9
from uuid import UUID
10
10
11
11
import async_timeout
12
- from aiohttp import (
13
- ClientError ,
14
- ClientResponse ,
15
- ClientSession ,
16
- TraceRequestChunkSentParams ,
17
- TraceRequestEndParams ,
18
- TraceRequestStartParams ,
19
- )
12
+ from aiohttp import ClientError , ClientResponse , ClientSession
20
13
21
- logger = logging .getLogger (__name__ )
14
+ _LOGGER = logging .getLogger (__name__ )
22
15
23
16
24
17
class ImsEnvistaApiClientError (Exception ):
@@ -36,23 +29,6 @@ class ImsEnvistaApiClientAuthenticationError(
36
29
):
37
30
"""Exception to indicate an authentication error."""
38
31
39
-
40
- async def on_request_start_debug (session : ClientSession , context ,params : TraceRequestStartParams ) -> None : # noqa: ANN001, ARG001
41
- logger .debug ("HTTP %s: %s" , params .method , params .url )
42
-
43
-
44
- async def on_request_chunk_sent_debug (
45
- session : ClientSession , context , params : TraceRequestChunkSentParams # noqa: ANN001, ARG001
46
- ) -> None :
47
- if (params .method in ("POST" , "PUT" )) and params .chunk :
48
- logger .debug ("HTTP Content %s: %s" , params .method , params .chunk )
49
-
50
-
51
- async def on_request_end_debug (session : ClientSession , context , params : TraceRequestEndParams ) -> None : # noqa: ANN001, ARG001
52
- response_bytes = await params .response .read () # Read the raw bytes
53
- logger .debug ("HTTP %s Response <%s>: %s" , params .method , params .response .status , response_bytes )
54
-
55
-
56
32
def _get_headers (token : UUID | str ) -> dict [str , str ]:
57
33
return {
58
34
"Accept" : "application/vnd.github.v3.text-match+json" ,
@@ -83,6 +59,7 @@ async def get(
83
59
84
60
try :
85
61
async with async_timeout .timeout (180 ):
62
+ _LOGGER .debug ("Sending GET from %s" , url )
86
63
response = await session .get (
87
64
url = url ,
88
65
headers = headers
0 commit comments