:type debug_level: int, between 0-2
    :param debug_level: configure verbosity of log
768384
def _set_debug_level(self, debug_level):
    
    mapping = {
        0: logging.ERROR,
        1: logging.INFO,
        2: logging.DEBUG,
    }

    self.setLevel(
        mapping[min(debug_level, 2)],
    )
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)
869942
def set_log_level(self, log_level):
        '''

        '''
        if log_level == 'DEBUG':
            self.log.setLevel(logging.DEBUG)
            self.log.debug("Changing log level to "+log_level)
        elif log_level == 'INFO':
            self.log.setLevel(logging.INFO)
            self.log.info("Changing log level to "+log_level)
        elif log_level == 'WARNING':
            self.log.setLevel(logging.WARNING)
            self.log.warning("Changing log level to "+log_level)
        elif log_level == 'ERROR':
            self.log.setLevel(logging.ERROR)
            self.log.error("Changing log level to "+log_level)
        elif log_level == 'CRITICAL':
            self.log.setLevel(logging.CRITICAL)
            self.log.critical("Changing log level to "+log_level)
        elif log_level == 'NOTSET':
            self.log.setLevel(logging.NOTSET)
        else:
            raise NotImplementedError('Not implemented log level '+str(log_level))
532546
def debug_print_line(self, i, level, line):
        
        if self.debug_level == 2:
            print("Line %d (%d): '%s'" % (i + 1, level, line.rstrip(' \r\n\t\f')))
        if self.debug_level > 2:
            print("Line %d (%d):" % (i + 1, level))
            hexdump(line)
1168983
def c_log(level, message):
    """"""
    c_level = level
    level = LEVELS_F2PY[c_level]
    logger.log(level, message)
1122362
def set_level(logger=None, log_level=None):
    '''

    '''
    log_level = logging.getLevelName(os.getenv('VERBOSITY', 'WARNING'))
    logging.getLogger(logger).setLevel(log_level)
739329
def set_log_type_level(self, logType, level):
        
        assert _is_number(level), "level must be a number"
        level = float(level)
        name = str(name)
        self.__logTypeLevels[logType] = level
204209
def debug(self, value):
        
        self.__debug = value
        if self.__debug:
            # if debug status is True, turn on debug logging
            for _, logger in iteritems(self.logger):
                logger.setLevel(logging.DEBUG)
            # turn on httplib debug
            httplib.HTTPConnection.debuglevel = 1
        else:
            # if debug status is False, turn off debug logging,
            # setting log level to default `logging.WARNING`
            for _, logger in iteritems(self.logger):
                logger.setLevel(logging.WARNING)
            # turn off httplib debug
            httplib.HTTPConnection.debuglevel = 0
77611
def log_level(level):
    

    levels_dict = {0: 50,
                   1: 40,
                   2: 30,
                   3: 20,
                   4: 10}

    if not isinstance(level, int):
        level = int(level)

    if level > 4:
        level = 4

    return levels_dict[level]
488886
def _get_log_level(level):
        
        # default to DEBUG
        if level is None or level == "DEBUG":
            return logging.DEBUG

        level = level.upper()
        # Make debugging configurable
        if level == "INFO":
            return logging.INFO
        elif level == "WARNING":
            return logging.WARNING
        elif level == "CRITICAL":
            return logging.CRITICAL
        elif level == "ERROR":
            return logging.ERROR
        elif level == "FATAL":
            return logging.FATAL
        else:
            raise Exception("UnknownLogLevelException: enter a valid log level")
815922
function setDebugLevel(level, printf) {
  var outLevel = 0;

  debug = debug2 = debug3 = debugTree = function() {};

  switch (String(level)) {
    case '3':
      debug3 = printf;
      outLevel++;
      // fall through
    case '2':
      debugTree = function (fmt, tree) {
        printf(fmt, util.inspect(tree.toJSON(), false, 64));
      };
      debug2 = printf;
      outLevel++;
      // fall through
    case '1':
      debug = printf;
      outLevel++;
      // fall through
    default:
      return outLevel;
  }
}
219206
def debug_object(obj, log_level: int = logging.DEBUG) -> None:
    
    msgs = ["For {o!r}:".format(o=obj)]
    for attrname in dir(obj):
        attribute = getattr(obj, attrname)
        msgs.append("- {an!r}: {at!r}, of type {t!r}".format(
            an=attrname, at=attribute, t=type(attribute)))
    log.log(log_level, "{}", "\n".join(msgs))
998204
def log_level_from_vebosity(verbosity):
    
    if verbosity == 0:
        return logging.WARNING
    if verbosity == 1:
        return logging.INFO
    return logging.DEBUG
387499
def set_level_for_logger_and_its_handlers(log: logging.Logger,
                                          level: int) -> None:
    
    log.setLevel(level)
    for h in log.handlers:  # type: logging.Handler
        h.setLevel(level)
459050
def _init_log(level=logging.DEBUG):
    
    log = logging.getLogger(__file__)
    log.setLevel(level)
    handler = logging.StreamHandler(sys.stdout)
    handler.setLevel(level)
    formatter = logging.Formatter('%(asctime)s: %(message)s',
                                  '%Y/%m/%d-%H:%M:%S')
    handler.setFormatter(formatter)
    log.addHandler(handler)
    return log
717704
function debug() {
  var args = [LEVELS.DEBUG].concat(slice.apply(arguments));
  return this.log.apply(this, args);
}
745458
def debug(message, level=1):
    
    if level <= debug_level:
        logging.debug(' ' * (level - 1) * 2 + str(message))