LogCapture class¶
(Shortest import: from brian2.utils.logger import LogCapture)
-
class
brian2.utils.logger.LogCapture(log_list, log_level=30)[source]¶ Bases:
logging.HandlerA class for capturing log warnings. This class is used by
catch_logsto allow testing in a similar way as withwarnings.catch_warnings.Methods
emit(record)Do whatever it takes to actually log the specified logging record.
install()Install this handler to catch all warnings.
Uninstall this handler and re-connect the previously installed handlers.
Details
-
emit(record)[source]¶ Do whatever it takes to actually log the specified logging record.
This version is intended to be implemented by subclasses and so raises a NotImplementedError.
-