¡@

Home 

OpenStack Study: logging.py

OpenStack Index

**** CubicPower OpenStack Study ****

def get_logging_handle_error_fixture():

    """returns a fixture to make logging raise formatting exceptions.

    Usage:

    self.useFixture(logging.get_logging_handle_error_fixture())

    """

    return fixtures.MonkeyPatch('logging.Handler.handleError',

                                _handleError)

**** CubicPower OpenStack Study ****

def _handleError(self, record):

    """Monkey patch for logging.Handler.handleError.

    The default handleError just logs the error to stderr but we want

    the option of actually raising an exception.

    """

    raise