diff --git a/src/aiodynamo/client.py b/src/aiodynamo/client.py index cc66865..d1d9800 100644 --- a/src/aiodynamo/client.py +++ b/src/aiodynamo/client.py @@ -70,7 +70,7 @@ ) from .sign import signed_dynamo_request from .types import Item, NumericTypeConverter, TableName -from .utils import dy2py, logger, py2dy, wait +from .utils import dy2py, logger, py2dy, request_logger, response_logger, wait @dataclass(frozen=True) @@ -984,7 +984,7 @@ async def send_request( region=self.region, endpoint=self.endpoint, ) - logger.debug("sending request %r", request) + request_logger.debug("sending request %r", request) try: response = await self.http( Request( @@ -1002,7 +1002,7 @@ async def send_request( logger.debug("request failed") exception = exc.inner continue - logger.debug("got response %r", response) + response_logger.debug("got response %r", response) if response.status == 200: return cast(Dict[str, Any], json.loads(response.body)) exception = exception_from_response(response.status, response.body) diff --git a/src/aiodynamo/utils.py b/src/aiodynamo/utils.py index 0258857..9a70fe9 100644 --- a/src/aiodynamo/utils.py +++ b/src/aiodynamo/utils.py @@ -28,6 +28,8 @@ T = TypeVar("T") logger = logging.getLogger("aiodynamo") +request_logger = logging.getLogger("aiodynamo.request") +response_logger = logging.getLogger("aiodynamo.response") def py2dy(data: Union[Item, None]) -> Union[DynamoItem, None]: