From a92d0c6d29524866a18faf72e46e4e12f014034d Mon Sep 17 00:00:00 2001 From: Kashif Khan Date: Fri, 5 Aug 2022 16:47:25 -0500 Subject: [PATCH] reset logging level --- sdk/eventhub/azure-eventhub/azure/eventhub/_client_base.py | 6 +++--- .../azure-eventhub/azure/eventhub/_producer_client.py | 4 ++-- sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/cbs.py | 7 ++----- .../azure/eventhub/aio/_client_base_async.py | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_client_base.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_client_base.py index 73b833b54873..4d0f017827a2 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_client_base.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_client_base.py @@ -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 diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_producer_client.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_producer_client.py index 84b5ea1a5056..b3aea5088707 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_producer_client.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_producer_client.py @@ -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 @@ -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( diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/cbs.py b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/cbs.py index 267283e01759..7ca082b73e3b 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/cbs.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/cbs.py @@ -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: diff --git a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_client_base_async.py b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_client_base_async.py index 90a8a9e594ca..4dd9949576c3 100644 --- a/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_client_base_async.py +++ b/sdk/eventhub/azure-eventhub/azure/eventhub/aio/_client_base_async.py @@ -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,