LogCapture class

(Shortest import: from brian2.utils.logger import LogCapture)

class brian2.utils.logger.LogCapture(log_list, log_level=30)[source]

Bases: logging.Handler

A class for capturing log warnings. This class is used by catch_logs to allow testing in a similar way as with warnings.catch_warnings.

Methods

emit(record)
install() Install this handler to catch all warnings.
uninstall() Uninstall this handler and re-connect the previously installed handlers.

Details

emit(record)[source]
install()[source]

Install this handler to catch all warnings. Temporarily disconnect all other handlers.

uninstall()[source]

Uninstall this handler and re-connect the previously installed handlers.