Skip to content

Commit

Permalink
reset logging level (#25588)
Browse files Browse the repository at this point in the history
  • Loading branch information
kashifkhan authored Aug 8, 2022
1 parent d663bdf commit 2eff3f8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
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

0 comments on commit 2eff3f8

Please sign in to comment.