@@ -219,10 +219,9 @@ def start_blocking_refresh(self, credentials, request):
219219 """
220220 # Async credentials do not support blocking lookups.
221221 if inspect .iscoroutinefunction (credentials ._lookup_regional_access_boundary ):
222- if _helpers .is_logging_enabled (_LOGGER ):
223- _LOGGER .warning (
224- "Blocking Regional Access Boundary lookup is not supported for async credentials."
225- )
222+ _LOGGER .debug (
223+ "Blocking Regional Access Boundary lookup is not supported for async credentials."
224+ )
226225 self .process_regional_access_boundary_info (None )
227226 return
228227
@@ -234,12 +233,11 @@ def start_blocking_refresh(self, credentials, request):
234233 credentials ._lookup_regional_access_boundary (request , fail_fast = True )
235234 )
236235 except Exception as e :
237- if _helpers .is_logging_enabled (_LOGGER ):
238- _LOGGER .warning (
239- "Blocking Regional Access Boundary lookup raised an exception: %s" ,
240- e ,
241- exc_info = True ,
242- )
236+ _LOGGER .debug (
237+ "Blocking Regional Access Boundary lookup raised an exception: %s" ,
238+ e ,
239+ exc_info = True ,
240+ )
243241 regional_access_boundary_info = None
244242
245243 self .process_regional_access_boundary_info (regional_access_boundary_info )
@@ -265,12 +263,11 @@ async def start_blocking_refresh_async(self, credentials, request):
265263 )
266264 )
267265 except Exception as e :
268- if _helpers .is_logging_enabled (_LOGGER ):
269- _LOGGER .warning (
270- "Regional Access Boundary lookup raised an exception: %s" ,
271- e ,
272- exc_info = True ,
273- )
266+ _LOGGER .debug (
267+ "Regional Access Boundary lookup raised an exception: %s" ,
268+ e ,
269+ exc_info = True ,
270+ )
274271 regional_access_boundary_info = None
275272
276273 self .process_regional_access_boundary_info (regional_access_boundary_info )
@@ -297,14 +294,12 @@ def process_regional_access_boundary_info(self, regional_access_boundary_info):
297294 cooldown_expiry = None ,
298295 cooldown_duration = DEFAULT_REGIONAL_ACCESS_BOUNDARY_COOLDOWN ,
299296 )
300- if _helpers .is_logging_enabled (_LOGGER ):
301- _LOGGER .debug ("Regional Access Boundary lookup successful." )
297+ _LOGGER .debug ("Regional Access Boundary lookup successful." )
302298 else :
303299 # On failure, calculate cooldown and update state.
304- if _helpers .is_logging_enabled (_LOGGER ):
305- _LOGGER .warning (
306- "Regional Access Boundary lookup failed. Entering cooldown."
307- )
300+ _LOGGER .debug (
301+ "Regional Access Boundary lookup failed. Entering cooldown."
302+ )
308303
309304 next_cooldown_expiry = (
310305 _helpers .utcnow () + current_data .cooldown_duration
@@ -367,12 +362,11 @@ def run(self):
367362 self ._credentials ._lookup_regional_access_boundary (self ._request )
368363 )
369364 except Exception as e :
370- if _helpers .is_logging_enabled (_LOGGER ):
371- _LOGGER .warning (
372- "Asynchronous Regional Access Boundary lookup raised an exception: %s" ,
373- e ,
374- exc_info = True ,
375- )
365+ _LOGGER .debug (
366+ "Asynchronous Regional Access Boundary lookup raised an exception: %s" ,
367+ e ,
368+ exc_info = True ,
369+ )
376370 regional_access_boundary_info = None
377371
378372 self ._rab_manager .process_regional_access_boundary_info (
@@ -419,13 +413,12 @@ def start_refresh(self, credentials, request, rab_manager):
419413 try :
420414 copied_request = copy .deepcopy (request )
421415 except Exception as e :
422- if _helpers .is_logging_enabled (_LOGGER ):
423- _LOGGER .warning (
424- "Could not deepcopy transport for background RAB refresh. "
425- "Skipping background refresh to avoid thread safety issues. "
426- "Exception: %s" ,
427- e ,
428- )
416+ _LOGGER .debug (
417+ "Could not deepcopy transport for background RAB refresh. "
418+ "Skipping background refresh to avoid thread safety issues. "
419+ "Exception: %s" ,
420+ e ,
421+ )
429422 return
430423
431424 self ._worker = _RegionalAccessBoundaryRefreshThread (
@@ -479,14 +472,13 @@ async def _close_cloned_request(lookup_request, is_cloned):
479472 if is_async := inspect .isawaitable (maybe_coro ):
480473 await maybe_coro
481474 except Exception as e :
482- if _helpers .is_logging_enabled (_LOGGER ):
483- adapter_type = " asynchronous " if is_async else " "
484- _LOGGER .warning (
485- "Failed to cleanly close cloned%srequest transport: %s" ,
486- adapter_type ,
487- e ,
488- exc_info = True ,
489- )
475+ adapter_type = " asynchronous " if is_async else " "
476+ _LOGGER .debug (
477+ "Failed to cleanly close cloned%srequest transport: %s" ,
478+ adapter_type ,
479+ e ,
480+ exc_info = True ,
481+ )
490482
491483
492484class _AsyncRegionalAccessBoundaryRefreshManager (object ):
@@ -532,12 +524,11 @@ def start_refresh(self, credentials, request, rab_manager):
532524 is_cloned ,
533525 ) = _prepare_async_lookup_callable (request )
534526 except Exception as e :
535- if _helpers .is_logging_enabled (_LOGGER ):
536- _LOGGER .warning (
537- "Synchronous cloning of request for Regional Access Boundary lookup failed: %s" ,
538- e ,
539- exc_info = True ,
540- )
527+ _LOGGER .debug (
528+ "Synchronous cloning of request for Regional Access Boundary lookup failed: %s" ,
529+ e ,
530+ exc_info = True ,
531+ )
541532 rab_manager .process_regional_access_boundary_info (None )
542533 return
543534
@@ -549,12 +540,11 @@ async def _worker():
549540 )
550541 )
551542 except Exception as e :
552- if _helpers .is_logging_enabled (_LOGGER ):
553- _LOGGER .warning (
554- "Asynchronous Regional Access Boundary lookup raised an exception: %s" ,
555- e ,
556- exc_info = True ,
557- )
543+ _LOGGER .debug (
544+ "Asynchronous Regional Access Boundary lookup raised an exception: %s" ,
545+ e ,
546+ exc_info = True ,
547+ )
558548 regional_access_boundary_info = None
559549 finally :
560550 await _close_cloned_request (lookup_request , is_cloned )
0 commit comments