fparser.common.tests.logging_utils ================================== .. py:module:: fparser.common.tests.logging_utils .. autoapi-nested-parse:: Helps with testing methods which write to the standard logger. Classes ------- .. autoapisummary:: fparser.common.tests.logging_utils.CaptureLoggingHandler Module Contents --------------- .. py:class:: CaptureLoggingHandler(*args, **kwargs) Bases: :py:obj:`logging.Handler` Records logged output for later examination. This is a standard handler for the built-in Python logging system. To make use of it simply register an instance with the logger using a command such as "logging.getLogger(__class__).addHandler( CaptureLoggingHandler() )" Any log message raised while this handler is in use will be recorded to a memory buffer for later use. This object has attributes 'debug', 'info', 'warning', 'error' and 'critical', each of which is a list of logged messages. Only the message text is recorded, everything else is lost. .. py:method:: emit(record) Handles a logged event. The event is passed from the logging system and recorded for future inspection. :param :py:class:`logging.LogRecord` record The event being logged. .. py:method:: reset() Empties the log of previous messages.