def _test_logged_method(method_name, original_name):
 def _run_with_logging(self, *args, **kwargs):
  original = getattr(self, original_name)
  method = getattr(original, method_name)
  try:
   TEST_MESSAGE(method=method_name.decode('ascii')).write()
   return method(*args, **kwargs)
  except Exception:
   TEST_EXCEPTION(method=method_name.decode('ascii')).write()
   raise
 return _run_with_logging

def _test_logged_method ( method_name , original_name ) : def _run_with_logging ( self , * args , ** kwargs ) : original = getattr ( self , original_name ) method = getattr ( original , method_name ) try : TEST_MESSAGE ( method = method_name . decode ( 'ascii' ) ) . write ( ) return method ( * args , ** kwargs ) except Exception : TEST_EXCEPTION ( method = method_name . decode ( 'ascii' ) ) . write ( ) raise return _run_with_logging
decorator for logging message to eliot logger .