Add a root logger to this fraction

@param level    the log level
@param handlers a list of handlers
@return this fraction
540802
public LoggingFraction rootLogger(Level level, String... handlers) {
        rootLogger(new RootLogger().level(level)
                .handlers(handlers));
        return this;
    }
967713
static org.apache.log4j.Level toLog4jLevel(java.util.logging.Level level) {
    if (level.intValue() >= java.util.logging.Level.SEVERE.intValue()) {
      return org.apache.log4j.Level.ERROR;
    } else if (level.intValue() >= java.util.logging.Level.WARNING.intValue()) {
      return org.apache.log4j.Level.WARN;
    } else if (level.intValue() >= java.util.logging.Level.INFO.intValue()) {
      return org.apache.log4j.Level.INFO;
    } else if (level.intValue() >= java.util.logging.Level.FINE.intValue()) {
      return org.apache.log4j.Level.DEBUG;
    }
    return org.apache.log4j.Level.TRACE;
  }
85945
@Override
    public T addHandlers(ArchiveEventHandler... handlers) {
       for (ArchiveEventHandler handler : handlers) {
          this.handlers.add(handler);
       }
       return covariantReturn();
    }
63985
def _add_handler(logger, handler=None, loglevel=None):
    
    handler.setLevel(loglevel or DEFAULT_LOGLEVEL)
    if handler.level <= logging.DEBUG:
        _fmt = '%(asctime)s| %(levelname)-4.3s|%(threadName)10.9s/' \
               '%(lineno)04d@%(module)-10.9s| %(message)s'
        handler.setFormatter(logging.Formatter(_fmt))
    else:
        handler.setFormatter(logging.Formatter(
            '%(asctime)s| %(levelname)-8s| %(message)s'
        ))
    logger.addHandler(handler)
917525
def set_handler(self, log, handler):
        
        if self.debug_logging is True:
            log.setLevel(logging.DEBUG)
            handler.setLevel(logging.DEBUG)
        else:
            log.setLevel(logging.INFO)
            handler.setLevel(logging.INFO)

        handler.name = self.name
        handler.setFormatter(self.format)
        log.addHandler(handler)
1229395
public CommonsQueryCountLoggingHandlerInterceptor buildCommonsHandlerInterceptor(CommonsLogLevel logLevel) {
        if (logLevel != null) {
            this.commonsLogLevel = logLevel;
        }

        CommonsQueryCountLoggingHandlerInterceptor handlerInterceptor = new CommonsQueryCountLoggingHandlerInterceptor();
        if (this.commonsLogLevel != null) {
            handlerInterceptor.setLogLevel(this.commonsLogLevel);
        }
        handlerInterceptor.setWriteAsJson(this.writeAsJson);
        return handlerInterceptor;
    }
1302025
public JULQueryCountLoggingHandlerInterceptor buildJULHandlerInterceptor(Level logLevel) {
        if (logLevel != null) {
            this.julLogLevel = logLevel;
        }

        JULQueryCountLoggingHandlerInterceptor handlerInterceptor = new JULQueryCountLoggingHandlerInterceptor();
        if (this.julLogLevel != null) {
            handlerInterceptor.setLogLevel(this.julLogLevel);
        }
        handlerInterceptor.setWriteAsJson(this.writeAsJson);
        return handlerInterceptor;
    }
65312
def set_level(cls, level):
        
        level = (
            level
            if not is_str(level)
            else int(LOGGING_LEVELS.get(level.upper(), level))
        )

        for handler in root.handlers:
            handler.setLevel(level)

        root.setLevel(level)
641342
public void addHandler(Handler handler) {
        if (null == handlers) {
            handlers = new ArrayList<>();
        }
        handlers.add(handler);
    }
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)
270383
def enable_logging(log_level):
    # type: (typing.Union[None, int]) -> None
    
    root_logger = logging.getLogger()
    root_logger.setLevel(logging.DEBUG)
    logfile_handler = logging.StreamHandler(_LOGFILE_STREAM)
    logfile_handler.setLevel(logging.DEBUG)
    logfile_handler.setFormatter(logging.Formatter(
        '%(levelname)s [%(asctime)s][%(name)s] %(message)s'))
    root_logger.addHandler(logfile_handler)
    if signal.getsignal(signal.SIGTERM) == signal.SIG_DFL:
        signal.signal(signal.SIGTERM, _logfile_sigterm_handler)
    if log_level:
        handler = logging.StreamHandler()
        handler.setFormatter(_LogColorFormatter())
        root_logger.setLevel(log_level)
        root_logger.addHandler(handler)
1374689
function Logger(level) {
    if (_.isString(level) && _.has(LogLevel, level)) {
        this.level = LogLevel[level];    
    } else if (_.isNumber(level) && level >= 0 && level <= 4) {
        this.level = level;
    } else {
        this.level = LogLevel.info;
    }    
}
733222
def addLogger(self, logger, level=logging.INFO):
        
        if isinstance(logger, logging.Logger):
            logger = logger.name
        
        if logger in self._loggers:
            return
        
        # allow the handler to determine the level for this logger
        if logger == 'root':
            _log = logging.getLogger()
        else:
            _log = logging.getLogger(logger)
        
        _log.addHandler(self.handler())
        
        self._loggers.add(logger)
        self.handler().setLoggerLevel(logger, level)
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
1006638
public boolean addHandler(PacketHandler handler) {
        synchronized (this.handlers){
            if (!handlers.contains(handler)) {
                handlers.add(handler);
                this.count.incrementAndGet();
                Collections.sort(this.handlers, REVERSE_COMPARATOR);
                return true;
            }
            return false;
        }
    }
817768
def _configure_root_logger(self):
        """"""
        root_logger = logging.getLogger()
        root_logger.setLevel(logging.DEBUG)
        if self.args.verbose:
            handler = logging.StreamHandler(sys.stdout)
        else:
            handler = logging.handlers.RotatingFileHandler(
                common.LOG_FILE,
                maxBytes=common.MAX_LOG_SIZE,
                backupCount=common.MAX_LOG_COUNT
            )
            handler.setLevel(logging.INFO)
        handler.setFormatter(logging.Formatter(common.LOG_FORMAT))
        root_logger.addHandler(handler)
207478
public Handler addHandler(Handler handler) throws JettyBootstrapException {
        JettyHandler jettyHandler = new JettyHandler();
        jettyHandler.setHandler(handler);

        handlers.addHandler(handler);

        return handler;
    }