Args:
        level:

    Returns:
        The log level if a `level` is passed in
778633
def log_level(self,
              level: typing.Union[str, int]=None,
              *args,
              **kwargs) -> typing.Union[None, str]:
    
    if level is None:
        return self.root_logger.getEffectiveLevel()
    # NOTE: `setLevel` takes both string and integers. Try to cast to an integer first
    try:
        value = int(level)
    # if we can't cast to an int, it's probably a string
    except ValueError:
        pass

    self.root_logger.setLevel(value)
731196
function checkLevel (type) {
  const logLevel = (global.JUDEnvironment && global.JUDEnvironment.logLevel) || 'log'
  return levelMap[logLevel] && levelMap[logLevel][type]
}
1315329
def level(self, lvl=None):
        ''''''
        if not lvl:
            return self._lvl
        self._lvl = self._parse_level(lvl)
        self.stream.setLevel(self._lvl)
        logging.root.setLevel(self._lvl)
884458
def _has_level_handler(logger):
    
    level = logger.getEffectiveLevel()
    current = logger

    while current:
        if any(handler.level <= level for handler in current.handlers):
            return True

        if not current.propagate:
            break

        current = current.parent

    return False
1168983
def c_log(level, message):
    """"""
    c_level = level
    level = LEVELS_F2PY[c_level]
    logger.log(level, message)
768299
def set_log_level(self, level=logging.INFO):
        
        mod, cls = self.parse_module_class()
        logging.getLogger(mod).setLevel(level)
1208043
def setLevel(self, level):
		
		if isinstance(level, int):
			self.logger.setLevel(level)
			return

		# level en tant que string
		level = level.lower()
		if level == "debug":
			self.logger.setLevel(logging.DEBUG)

		elif level == "info":
			self.logger.setLevel(logging.INFO)

		elif level == "warning" or level == "warning":
			self.logger.setLevel(logging.WARN)

		elif level == "error":
			self.logger.setLevel(logging.ERROR)

		else:
			# par défaut
			self.logger.setLevel(logging.INFO)
1271142
def log(self, level, msg):
        
        self._check_session()
        level = level.upper()
        allowed_levels = ('INFO', 'WARN', 'ERROR', 'FATAL')
        if level not in allowed_levels:
            raise ValueError('level must be one of: ' +
                             ', '.join(allowed_levels))
        self._rest.post_request(
            'log', None, {'log_level': level.upper(), 'message': msg})
720493
def getLevelName(lvl):
    
    lvl = _ocrdLevel2pythonLevel.get(lvl, lvl)
    return logging.getLevelName(lvl)
416730
def get_log_level(self):
        
        level_names = {
            logging.DEBUG: 'DEBUG', logging.INFO: 'INFO', logging.WARNING: 'WARNING',
            logging.ERROR: 'ERROR', logging.CRITICAL: 'CRITICAL'
        }
        alignak_logger = logging.getLogger(ALIGNAK_LOGGER_NAME)

        res = self.identity()
        res.update({"log_level": alignak_logger.getEffectiveLevel(),
                    "log_level_name": level_names[alignak_logger.getEffectiveLevel()]})
        return res
792861
def log_level_type(arg):
	""""""
	if not arg.upper() in ('NOTSET', 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'):
		raise argparse.ArgumentTypeError("{0} is not a valid log level".format(repr(arg)))
	return getattr(logging, arg.upper())
150462
def log(self, level, prefix = ''):
        
        logging.log(level, "%sname: %s", prefix, self.__name)
        logging.log(level, "%soptions: %s", prefix, self.__options)
113566
def log_level_from_string(str_level):
    
    levels = {
        'CRITICAL': logging.CRITICAL,
        'ERROR': logging.ERROR,
        'WARNING': logging.WARNING,
        'INFO': logging.INFO,
        'DEBUG': logging.DEBUG,
    }
    try:
        return levels[str_level.upper()]
    except KeyError:
        pass
    except AttributeError:
        if str_level in [logging.DEBUG, logging.INFO, logging.WARNING,
                         logging.ERROR, logging.CRITICAL]:
            return str_level
    return logging.NOTSET
524269
def log_level(level_string):
	
	if level_string.isdigit():
		return int(level_string)
	return getattr(logging, level_string.upper())
926804
def to_log_level(value):
        
        if value == None:
            return LogLevel.Info

        value = str(value).upper()
        if ("0" == value) or ("NOTHING" == value) or ("NONE" == value):
            return LogLevel.Nothing
        elif ("1" == value) or ("FATAL" == value):
            return LogLevel.Fatal
        elif ("2" == value) or ("ERROR" == value):
            return LogLevel.Error
        elif ("3" == value) or ("WARN" == value) or ("WARNING" == value):
            return LogLevel.Warn
        elif ("4" == value) or ("INFO" == value):
            return LogLevel.Info
        elif ("5" == value) or ("DEBUG" == value):
            return LogLevel.Debug
        elif ("6" == value) or ("TRACE" == value):
            return LogLevel.Trace
        else:
            return LogLevel.Info
387072
def getLevelInt(levelName):
    
    assert isinstance(levelName, str) and levelName in getLevelNames(), \
        "Bad debug level name"
    return  getLevelNames().index(levelName)+1
218130
def setLoggerLevel(self, logger, level):
        
        if level == logging.NOTSET:
            self.removeLogger(logger)
            self.handler().setLoggerLevel(logger, level)
            return
            
        if isinstance(logger, logging.Logger):
            logger = logger.name
        
        if not logger in self._loggers:
            self.addLogger(logger, level)
        else:
            self.handler().setLoggerLevel(logger, level)