def set_logging_level(verbosity, logger=None, stderr_output=False):
    'Set up logging for the CLI.\n\n    We either set up global logging based on the verbosity\n    or, if `logger` is specified, we only limit to a single\n    sqlfluff logger. Verbosity is applied in the same way.\n\n    Implementation: If `logger` is not specified, the handler\n    is attached to the `sqlfluff` logger. If it is specified\n    then it attaches the the logger in question. In addition\n    if `logger` is specified, then that logger will also\n    not propagate.\n    '
    fluff_logger = logging.getLogger('sqlfluff')
    fluff_logger.propagate = False
    colorama.init()
    handler = logging.StreamHandler(stream=(sys.stderr if stderr_output else sys.stdout))
    handler.setFormatter(logging.Formatter('\x1b[0m%(levelname)-10s %(message)s'))
    handler.addFilter(RedWarningsFilter())
    if logger:
        focus_logger = logging.getLogger('sqlfluff.{0}'.format(logger))
        focus_logger.addHandler(handler)
    else:
        fluff_logger.addHandler(handler)
    parser_logger = logging.getLogger('sqlfluff.parser')
    if (verbosity < 3):
        fluff_logger.setLevel(logging.WARNING)
        parser_logger.setLevel(logging.NOTSET)
    elif (verbosity == 3):
        fluff_logger.setLevel(logging.INFO)
        parser_logger.setLevel(logging.WARNING)
    elif (verbosity == 4):
        fluff_logger.setLevel(logging.DEBUG)
        parser_logger.setLevel(logging.INFO)
    elif (verbosity > 4):
        fluff_logger.setLevel(logging.DEBUG)
        parser_logger.setLevel(logging.DEBUG)
Set up logging for the CLI.

We either set up global logging based on the verbosity
or, if `logger` is specified, we only limit to a single
sqlfluff logger. Verbosity is applied in the same way.

Implementation: If `logger` is not specified, the handler
is attached to the `sqlfluff` logger. If it is specified
then it attaches the the logger in question. In addition
if `logger` is specified, then that logger will also
not propagate.
def set_logging_level(verbosity, logger=None, stderr_output=False):
    'Set up logging for the CLI.\n\n    We either set up global logging based on the verbosity\n    or, if `logger` is specified, we only limit to a single\n    sqlfluff logger. Verbosity is applied in the same way.\n\n    Implementation: If `logger` is not specified, the handler\n    is attached to the `sqlfluff` logger. If it is specified\n    then it attaches the the logger in question. In addition\n    if `logger` is specified, then that logger will also\n    not propagate.\n    '
    fluff_logger = logging.getLogger('sqlfluff')
    fluff_logger.propagate = False
    colorama.init()
    handler = logging.StreamHandler(stream=(sys.stderr if stderr_output else sys.stdout))
    handler.setFormatter(logging.Formatter('\x1b[0m%(levelname)-10s %(message)s'))
    handler.addFilter(RedWarningsFilter())
    if logger:
        focus_logger = logging.getLogger('sqlfluff.{0}'.format(logger))
        focus_logger.addHandler(handler)
    else:
        fluff_logger.addHandler(handler)
    parser_logger = logging.getLogger('sqlfluff.parser')
    if (verbosity < 3):
        fluff_logger.setLevel(logging.WARNING)
        parser_logger.setLevel(logging.NOTSET)
    elif (verbosity == 3):
        fluff_logger.setLevel(logging.INFO)
        parser_logger.setLevel(logging.WARNING)
    elif (verbosity == 4):
        fluff_logger.setLevel(logging.DEBUG)
        parser_logger.setLevel(logging.INFO)
    elif (verbosity > 4):
        fluff_logger.setLevel(logging.DEBUG)
        parser_logger.setLevel(logging.DEBUG)