def _setup_logging(cls, args):
        '''Set up the root logger if needed.

        The root logger is set the appropriate level so the file and WARC logs
        work correctly.
        '''
        assert (
            logging.CRITICAL >
            logging.ERROR >
            logging.WARNING >
            logging.INFO >
            logging.DEBUG >
            logging.NOTSET
        )
        assert (
            LOG_VERY_QUIET >
            LOG_QUIET >
            LOG_NO_VERBOSE >
            LOG_VERBOSE >
            LOG_DEBUG
        )
        assert args.verbosity

        root_logger = logging.getLogger()
        current_level = root_logger.getEffectiveLevel()
        min_level = LOG_VERY_QUIET

        if args.verbosity == LOG_QUIET:
            min_level = logging.ERROR

        if args.verbosity in (LOG_NO_VERBOSE, LOG_VERBOSE) \
                or args.warc_file \
                or args.output_file or args.append_output:
            min_level = logging.INFO

        if args.verbosity == LOG_DEBUG:
            min_level = logging.DEBUG

        if current_level > min_level:
            root_logger.setLevel(min_level)
            root_logger.debug(
                'Wpull needs the root logger level set to {0}.'
                    .format(min_level)
            )

        if current_level <= logging.INFO:
            logging.captureWarnings(True)
def _setup_logging ( cls , args ) : assert ( logging . CRITICAL > logging . ERROR > logging . WARNING > logging . INFO > logging . DEBUG > logging . NOTSET ) assert ( LOG_VERY_QUIET > LOG_QUIET > LOG_NO_VERBOSE > LOG_VERBOSE > LOG_DEBUG ) assert args . verbosity root_logger = logging . getLogger ( ) current_level = root_logger . getEffectiveLevel ( ) min_level = LOG_VERY_QUIET if args . verbosity == LOG_QUIET : min_level = logging . ERROR if args . verbosity in ( LOG_NO_VERBOSE , LOG_VERBOSE ) or args . warc_file or args . output_file or args . append_output : min_level = logging . INFO if args . verbosity == LOG_DEBUG : min_level = logging . DEBUG if current_level > min_level : root_logger . setLevel ( min_level ) root_logger . debug ( 'Wpull needs the root logger level set to {0}.' . format ( min_level ) ) if current_level <= logging . INFO : logging . captureWarnings ( True )
Set up the root logger if needed.

        The root logger is set the appropriate level so the file and WARC logs
        work correctly.