Skip to content

Commit a4a3c50

Browse files
committed
Make logger a constant by uppercasing it
1 parent 78d1ac7 commit a4a3c50

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/aws-event-stream/src/aws_event_stream/_private/deserializers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
)
2727
from smithy_core.traits import EventHeaderTrait
2828

29-
logger = logging.getLogger(__name__)
29+
LOGGER = logging.getLogger(__name__)
3030

3131
INITIAL_MESSAGE_TYPES = (INITIAL_REQUEST_EVENT_TYPE, INITIAL_RESPONSE_EVENT_TYPE)
3232

@@ -58,17 +58,17 @@ async def receive(self) -> E | None:
5858
raise
5959

6060
if event is None:
61-
logger.debug("No event received from the source.")
61+
LOGGER.debug("No event received from the source.")
6262
return None
63-
logger.debug("Received raw event: %s", event)
63+
LOGGER.debug("Received raw event: %s", event)
6464

6565
deserializer = EventDeserializer(
6666
event=event,
6767
payload_codec=self._payload_codec,
6868
is_client_mode=self._is_client_mode,
6969
)
7070
result = self._deserializer(deserializer)
71-
logger.debug("Successfully deserialized event: %s", result)
71+
LOGGER.debug("Successfully deserialized event: %s", result)
7272
if isinstance(getattr(result, "value"), Exception):
7373
raise result.value # type: ignore
7474
return result

packages/aws-event-stream/src/aws_event_stream/_private/serializers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
)
3131
from smithy_core.traits import ErrorTrait, EventHeaderTrait, MediaTypeTrait
3232

33-
logger = logging.getLogger(__name__)
33+
LOGGER = logging.getLogger(__name__)
3434

3535
_DEFAULT_STRING_CONTENT_TYPE = "text/plain"
3636
_DEFAULT_BLOB_CONTENT_TYPE = "application/octet-stream"
@@ -58,7 +58,7 @@ def __init__(
5858
async def send(self, event: E) -> None:
5959
if self._closed:
6060
raise IOError("Attempted to write to closed stream.")
61-
logger.debug("Preparing to publish event: %s", event)
61+
LOGGER.debug("Preparing to publish event: %s", event)
6262
event.serialize(self._serializer)
6363
result = self._serializer.get_result()
6464
if result is None:
@@ -70,7 +70,7 @@ async def send(self, event: E) -> None:
7070

7171
encoded_result = result.encode()
7272
try:
73-
logger.debug("Publishing serialized event: %s", result)
73+
LOGGER.debug("Publishing serialized event: %s", result)
7474
await self._writer.write(encoded_result)
7575
except Exception as e:
7676
await self.close()

0 commit comments

Comments
 (0)