Get the logging level of the root handler.

    :returns: The logging level of the root handler (an integer) or
              :data:`DEFAULT_LOG_LEVEL` (if no root handler exists).
353671
def get_level():
    
    handler, logger = find_handler(logging.getLogger(), match_stream_handler)
    return handler.level if handler else DEFAULT_LOG_LEVEL
429673
def set_root_logger(root_log_level, log_path=None):
    
    handlers = []

    console_handler = logging.StreamHandler()
    handlers.append(console_handler)
    if log_path:
        file_handler = logging.FileHandler(log_path)
        handlers.append(file_handler)

    set_logging_config(root_log_level, handlers=handlers)
    root_logger = logging.getLogger("pypyr")
    root_logger.debug(
        f"Root logger {root_logger.name} configured with level "
        f"{root_log_level}")
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
1082616
def logger_init(level):
    
    levellist = [logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG]
    handler = logging.StreamHandler()
    fmt = ('%(levelname) -10s %(asctime)s %(name) -30s %(funcName) '
           '-35s %(lineno) -5d: %(message)s')
    handler.setFormatter(logging.Formatter(fmt))
    logger = logging.root
    logger.addHandler(handler)
    logger.setLevel(levellist[level])
1355796
def get_loglevel(level):
    
    if level == 'debug':
        return logging.DEBUG
    elif level == 'notice':
        return logging.INFO
    elif level == 'info':
        return logging.INFO
    elif level == 'warning' or level == 'warn':
        return logging.WARNING
    elif level == 'error' or level == 'err':
        return logging.ERROR
    elif level == 'critical' or level == 'crit':
        return logging.CRITICAL
    elif level == 'alert':
        return logging.CRITICAL
    elif level == 'emergency' or level == 'emerg':
        return logging.CRITICAL
    else:
        return logging.INFO
925541
def get_tree_root(self):
        
        root = self
        while root.up is not None:
            root = root.up
        return root
1147927
def reconfigure_log_level(self):
        
        if Global.LOGGER:
            Global.LOGGER.debug('reconfiguring logger level')
        stream_handlers = filter(lambda x: type(x) is logging.StreamHandler,
                                 self._logger_instance.handlers)

        for x in stream_handlers:
            x.level = Global.CONFIG_MANAGER.log_level

        return self.get_logger()
471285
def root(self):
            
            str_treeRoot                = '/'
            self.l_cwd                  = [str_treeRoot]
            self.snode_current          = self.snode_root
            self.sbranch_current        = self.sbranch_root
18815
def setLoggerLevel(self, logger, level):
        
        if logger == 'root':
            _log = logging.getLogger()
        else:
            _log = logging.getLogger(logger)
        
        _log.setLevel(level)
        
        if level == logging.NOTSET:
            self._loggerLevels.pop(logger, None)
        else:
            self._loggerLevels[logger] = level
227772
private Level getLogLevel() {
        return isQuiet() ? Level.OFF : isVerbose() ? Level.DEBUG : Level.INFO;
    }
730570
def level(self):
        
        res = len(self._scope_stack)
        if self._parent is not None:
            res += self._parent.level()
        return res
57486
def set_default_log_levels(loggers_and_log_levels):
    
    for logger, level in loggers_and_log_levels:
        if isinstance(level, str):
            level = level.upper()
        logging.getLogger(logger).setLevel(level)
399941
def get_level(level_string):
    
    levels = {'debug': logging.DEBUG, 'info': logging.INFO,
              'warning': logging.WARNING, 'error': logging.ERROR,
              'critical': logging.CRITICAL}
    try:
        level = levels[level_string.lower()]
    except KeyError:
        sys.exit('{0} is not a recognized logging level'.format(level_string))
    else:
        return level
769488
public String getLevel() {
        try {
            LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
            return loggerContext.getLogger("root").getLevel().toString();
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }
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()
1324237
def _get_log(self):
        

        result = yield from self.manager.query("GET", "containers/{}/logs".format(self._cid), params={"stderr": 1, "stdout": 1})
        return result
871123
def default_logging(grab_log=None, # '/tmp/grab.log',
                    network_log=None, # '/tmp/grab.network.log',
                    level=logging.DEBUG, mode='a',
                    propagate_network_logger=False):
    

    logging.basicConfig(level=level)

    network_logger = logging.getLogger('grab.network')
    network_logger.propagate = propagate_network_logger
    if network_log:
        hdl = logging.FileHandler(network_log, mode)
        network_logger.addHandler(hdl)
        network_logger.setLevel(level)

    grab_logger = logging.getLogger('grab')
    if grab_log:
        hdl = logging.FileHandler(grab_log, mode)
        grab_logger.addHandler(hdl)
        grab_logger.setLevel(level)