Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pyamqp] Reset logging level #25588

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sdk/eventhub/azure-eventhub/azure/eventhub/_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,13 @@ def _management_request(self, mgmt_msg, op_type):
access_token = mgmt_auth.get_token()

if not access_token:
_LOGGER.info("Management client received an empty access token object")
_LOGGER.debug("Management client received an empty access token object")

elif not access_token.token:
_LOGGER.info("Management client received an empty token")
_LOGGER.debug("Management client received an empty token")

else:
_LOGGER.info(f"Management client token expires on: {datetime.fromtimestamp(access_token.expires_on)}")
_LOGGER.debug(f"Management client token expires on: {datetime.fromtimestamp(access_token.expires_on)}")

mgmt_msg.application_properties["security_token"] = access_token.token

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def __exit__(self, *args):
def _get_partitions(self):
# type: () -> None
if not self._partition_ids:
_LOGGER.info("Populating partition IDs so producers can be started.")
_LOGGER.debug("Populating partition IDs so producers can be started.")
self._partition_ids = self.get_partition_ids() # type: ignore
for p_id in cast(List[str], self._partition_ids):
self._producers[p_id] = None
Expand Down Expand Up @@ -313,7 +313,7 @@ def send_batch(self, event_data_batch, **kwargs):
to_send_batch, timeout=send_timeout
)
except (KeyError, AttributeError, EventHubError) as e:
_LOGGER.info(
_LOGGER.debug(
"Producer for partition ID '{}' not available: {}. Rebuilding new producer.".format(partition_id, e))
self._start_producer(partition_id, send_timeout)
cast(EventHubProducer, self._producers[partition_id]).send(
Expand Down
7 changes: 2 additions & 5 deletions sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/cbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,10 @@ def update_token(self):
self.auth_state = CbsAuthState.IN_PROGRESS
access_token = self._auth.get_token()
if not access_token:
_LOGGER.info("Update_token received an empty token object")
_LOGGER.debug("Update_token received an empty token object")
elif not access_token.token:
_LOGGER.info("Update_token received an empty token")
_LOGGER.debug("Update_token received an empty token")
self._expires_on = access_token.expires_on
_LOGGER.info('Update_token after token has been updated')
_LOGGER.info('Current time: %r', datetime.now())
_LOGGER.info('Token expiry: %r', datetime.fromtimestamp(self._expires_on))
expires_in = self._expires_on - int(utc_now().timestamp())
self._refresh_window = int(float(expires_in) * 0.1)
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ async def _management_request_async(self, mgmt_msg: Message, op_type: bytes) ->
mgmt_msg.application_properties["security_token"] = access_token.token

if not access_token.token:
_LOGGER.info("update_token received an empty token")
_LOGGER.debug("update_token received an empty token")

response = await mgmt_client.mgmt_request_async(
mgmt_msg,
Expand Down