#NEWLINE# def capture_logging( assertion , * assertionArgs , **assertionKwargs ) : #NEWLINE# #INDENT# "\n    Capture and validate all logging that doesn't specify a L{Logger}.\n\n    See L{validate_logging} for details on the rest of its behavior.\n    " #NEWLINE# def decorator( function ) : #NEWLINE# #INDENT# @ validate_logging ( assertion , * assertionArgs , ** assertionKwargs ) #NEWLINE# @ wraps ( function ) #NEWLINE# def wrapper( self , * args , **kwargs ) : #NEWLINE# #INDENT# logger = kwargs [ 'logger' ] #NEWLINE# current_logger = _output . _DEFAULT_LOGGER #NEWLINE# _output . _DEFAULT_LOGGER = logger #NEWLINE# def cleanup( ) : #NEWLINE# #INDENT# _output . _DEFAULT_LOGGER = current_logger #NEWLINE# #UNINDENT# self . addCleanup ( cleanup ) #NEWLINE# return function ( self , logger ) #NEWLINE# #UNINDENT# return wrapper #NEWLINE# #UNINDENT# return decorator