def METHOD_NAME(self):
    """Turn on logging capture by replacing all existing handlers
    configured in the logging module.
    If the config var logging_clear_handlers is set then we also remove
    all existing handlers.
    We also set the level of the root logger.
    The opposite of this is :meth:`~LoggingCapture.abandon`.
    """
    root_logger = logging.getLogger()
    if self.config.logging_clear_handlers:
        # kill off all the other log handlers
        for logger in logging.Logger.manager.loggerDict.values():
            if hasattr(logger, "handlers"):
                for handler in logger.handlers:
                    self.old_handlers.append((logger, handler))
                    logger.removeHandler(handler)
    # sanity check: remove any existing LoggingCapture
    for handler in root_logger.handlers[:]:
        if isinstance(handler, LoggingCapture):
            root_logger.handlers.remove(handler)
        elif self.config.logging_clear_handlers:
            self.old_handlers.append((root_logger, handler))
            root_logger.removeHandler(handler)
    # right, we're it now
    root_logger.addHandler(self)
    # capture the level we're interested in
    self.old_level = root_logger.level
    root_logger.setLevel(self.level)