Prepare root logger
    :param verbose: integer greater than 0 to indicate verbosity level
494344
def setup_logger(verbose, logfile):
    
    level = logging.WARNING
    if verbose == 1:
        level = logging.INFO
    elif verbose > 1:
        level = logging.DEBUG
    if logfile:
        logging.basicConfig(filename=logfile, level=level, format=LOGGING_FORMAT)
    else:
        logging.basicConfig(level=level, format=LOGGING_FORMAT)
1328915
def set_log_level(verbose, quiet):
    '''
    
    '''
    if quiet:
        verbose = -1
    if verbose < 0:
        verbose = logging.CRITICAL
    elif verbose == 0:
        verbose = logging.WARNING
    elif verbose == 1:
        verbose = logging.INFO
    elif 1 < verbose:
        verbose = logging.DEBUG
    LOGGER.setLevel(verbose)
1204087
def setup_logging(verbose=False, logger=None):
    
    if not verbose:
        logging.getLogger('requests').setLevel(logging.WARNING)

    format_ = '%(asctime)s %(levelname)-8s %(name)-40s %(message)s' if verbose else '%(message)s'
    level = logging.DEBUG if verbose else logging.INFO

    handler_stdout = logging.StreamHandler(sys.stdout)
    handler_stdout.setFormatter(logging.Formatter(format_))
    handler_stdout.setLevel(logging.DEBUG)
    handler_stdout.addFilter(InfoFilter())

    handler_stderr = logging.StreamHandler(sys.stderr)
    handler_stderr.setFormatter(logging.Formatter(format_))
    handler_stderr.setLevel(logging.WARNING)

    root_logger = logging.getLogger(logger)
    root_logger.setLevel(level)
    root_logger.addHandler(handler_stdout)
    root_logger.addHandler(handler_stderr)
1028871
def configure_logging(verbosity):
    ''''''
    log_level = max(logging.DEBUG, logging.WARNING - logging.DEBUG*verbosity)
    logging.basicConfig(
        stream=sys.stderr, level=log_level,
        format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
    )

    urllib3_logger = logging.getLogger(
        'requests.packages.urllib3')
    urllib3_logger.setLevel(log_level)

    # if debug level set then its nice to see the headers of the request
    if log_level == logging.DEBUG:
        try:
            import http.client as http_client
        except ImportError:
            # Python 2
            import httplib as http_client
        http_client.HTTPConnection.debuglevel = 1
776123
def logging_level_verbosity(logging_verbosity):
  
  name_to_level = {
    'FATAL': tf.logging.FATAL,
    'ERROR': tf.logging.ERROR,
    'WARN': tf.logging.WARN,
    'INFO': tf.logging.INFO,
    'DEBUG': tf.logging.DEBUG
  }

  try:
    return name_to_level[logging_verbosity]
  except Exception as e:
    raise RuntimeError('Not supported logs verbosity (%s). Use one of %s.' %
                       (str(e), list(name_to_level)))
931789
def cli_frontend(ctx, verbose):
    
    printout = True
    if verbose == 0:
        verbose = 1
        printout = False

    # Verbosity is the inverse of logging levels
    levels = [item for item in BOUSSOLE_LOGGER_CONF]
    levels.reverse()
    # Init the logger config
    root_logger = init_logger(levels[verbose], printout=printout)

    # Init the default context that will be passed to commands
    ctx.obj = {
        'verbosity': verbose,
        'logger': root_logger,
    }
472345
def _update_logging_levels(self):
    """"""
    if not _absl_logger:
      return

    if self._value <= converter.ABSL_DEBUG:
      standard_verbosity = converter.absl_to_standard(self._value)
    else:
      # --verbosity is set to higher than 1 for vlog.
      standard_verbosity = logging.DEBUG - (self._value - 1)

    # Also update root level when absl_handler is used.
    if _absl_handler in logging.root.handlers:
      logging.root.setLevel(standard_verbosity)
387023
def start_logging(log_file='', log_level='INFO', verbose=False):
    
    if not log_file:
        # create log directory if it doesn't exist
        log_dir = os.path.abspath('log') + '/'
        if not os.path.isdir(log_dir):
            os.mkdir(log_dir)

        # path to new log file
        log_file = log_dir + 'log.run.' + str(datetime.datetime.now()).replace(':', '.') + '.txt'

    # logger options
    lvl = logging.DEBUG if log_level.upper() == 'DEBUG' else logging.INFO

    # ignore warnings if not in debug
    if log_level.upper() != 'DEBUG':
        warnings.filterwarnings('ignore')

    # define logging format
    if verbose:
        myformat = '%(asctime)s - %(name)s - %(levelname)s \n>>>  %(message)s'
    else:
        myformat = '%(message)s'

    # create logger
    if not log_file == 'stdout':
        # normal logging to a regular file
        logging.basicConfig(level=lvl,
                            format=myformat,
                            filename=log_file,
                            filemode='w')
    else:
        # logging to stdout
        root = logging.getLogger()
        root.setLevel(lvl)
        stdout_stream = logging.StreamHandler(sys.stdout)
        stdout_stream.setLevel(lvl)
        formatter = logging.Formatter(myformat)
        stdout_stream.setFormatter(formatter)
        root.addHandler(stdout_stream)
        root.propagate = True
441899
def log(self, lvl, msg, *args, **kwargs):
        """"""
        logger.log(lvl, msg, *args, **kwargs)

        if lvl >= self.verbosity:
            if args:
                fmsg = msg % args
            else:
                fmsg = msg % kwargs

            if lvl >= logging.WARNING:
                self.stderr.write(fmsg)
            else:
                self.stdout.write(fmsg)
477339
function (fn, module, data, verbose) {

        let complete = module.toUpperCase() + " > ";

            // Only provide verbose log if logLevel > 5
            verbose = config.logLevel >= 5 ? (verbose || undefined) : undefined;

        // When writing to console
        if ( config.destination === console) {

            // Compose message
            complete = " [ " + new Date().toLocaleString() + " ] " + complete + data;

            if ( fn == "error" ) 
                complete = complete.bgRed.white;
            else if ( fn == "warning" )
                complete = complete.bgYellow.black

        // ... when writing to a custom log function
        } else {
            complete += fn + ': ' + data;

        }

        // Check that destination.fn exists, fallback to destination.log
        let logger = (config.destination[fn] || config.destination.log).bind(config.destination);

        if ( verbose !== undefined ) {
            logger(complete, verbose);    
        } else {
            logger(complete);
        }
        
        
    }
654405
def set_log_level(debug, verbose):
    
    if debug:
        logging.basicConfig(level=logging.DEBUG)
    elif verbose:
        logging.basicConfig(level=logging.INFO)
1003824
def verbose_message(self):
        """"""
        if self.threshold is None:
            return 'No threshold'
        return '%.1f is %s than %.1f' % (self.value,
                                         self.adjective,
                                         self.threshold)
1085180
def check_cli_verbose(default=3):
    """"""
    args = sys.argv[1:]
    verbose = default + args.count("--verbose") - args.count("--quiet")

    for arg in args:
        if arg.startswith("-") and not arg.startswith("--"):
            verbose += arg[1:].count("v")
            verbose -= arg[1:].count("q")
    return verbose
612162
def set_up(verbose, quiet):
    """"""
    logger = logging.getLogger('fades')
    logger.setLevel(logging.DEBUG)

    # select logging level according to user desire; also use a simpler
    # formatting for non-verbose logging
    if verbose:
        log_level = logging.DEBUG
        log_format = FMT_DETAILED
    elif quiet:
        log_level = logging.WARNING
        log_format = FMT_SIMPLE
    else:
        log_level = logging.INFO
        log_format = FMT_SIMPLE

    # all to the stdout
    handler = SalutingStreamHandler(logger)
    handler.setLevel(log_level)
    logger.addHandler(handler)
    formatter = logging.Formatter(log_format)
    handler.setFormatter(formatter)

    # and to the syslog
    for syslog_path in ('/dev/log', '/var/run/syslog'):
        if not os.path.exists(syslog_path):
            continue
        try:
            handler = logging.handlers.SysLogHandler(address=syslog_path)
        except Exception:
            # silently ignore that the user doesn't have a syslog active; can
            # see all the info with "-v" anyway
            pass
        else:
            logger.addHandler(handler)
            formatter = logging.Formatter(FMT_SYSLOG)
            handler.setFormatter(formatter)
            break

    return logger
14758
public void enableConsoleLog(Level level, boolean verbose) {
        InstallLogUtils.enableConsoleLogging(level, verbose);
        InstallLogUtils.enableConsoleErrorLogging(verbose);
    }
247373
def set_logging_level(args):
    ""
    root_logger = logging.getLogger()
    level = logging.INFO
    logging.getLogger('requests.packages.urllib3').setLevel(logging.WARNING)
    if "verbose" in args and args.verbose is not None:
        logging.getLogger('requests.packages.urllib3').setLevel(0)  # Unset
        if args.verbose > 1:
            level = 5  # "Trace" level
        elif args.verbose > 0:
            level = logging.DEBUG
        else:
            logging.critical("verbose is an unexpected value. (%s) exiting.",
                             args.verbose)
            sys.exit(2)
    elif "quiet" in args and args.quiet is not None:
        if args.quiet > 1:
            level = logging.ERROR
        elif args.quiet > 0:
            level = logging.WARNING
        else:
            logging.critical("quiet is an unexpected value. (%s) exiting.",
                             args.quiet)
    if level is not None:
        root_logger.setLevel(level)

    if args.silence_urllib3:
        # See: https://urllib3.readthedocs.org/en/latest/security.html
        requests.packages.urllib3.disable_warnings()
152896
def log_very_verbose(self, message):
        
        if self.get_verbosity() >= Output.VERBOSITY_VERY_VERBOSE:
            self.writeln(message)