def _teardown_log():
 global log
 if log.exception_logging_enabled():
  log.disable_exception_logging()
 if log.warnings_logging_enabled():
  log.disable_warnings_logging()
 del log
 try:
  logging._acquireLock()
  try:
   loggerDict = logging.Logger.manager.loggerDict
   for key in loggerDict.keys():
    if ((key == 'astropy') or key.startswith('astropy.')):
     del loggerDict[key]
  finally:
   logging._releaseLock()
 except Exception:
  pass

def _teardown_log ( ) : global log if log . exception_logging_enabled ( ) : log . disable_exception_logging ( ) if log . warnings_logging_enabled ( ) : log . disable_warnings_logging ( ) del log try : logging . _acquireLock ( ) try : loggerDict = logging . Logger . manager . loggerDict for key in loggerDict . keys ( ) : if ( ( key == 'astropy' ) or key . startswith ( 'astropy.' ) ) : del loggerDict [ key ] finally : logging . _releaseLock ( ) except Exception : pass
shut down exception and warning logging and clear all astropy loggers from the logging modules cache .