Converts java.util.logging.Level to org.apache.log4j.Level.
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;
  }
358309
@Override
	public void log(com.silentgo.utils.log.level.Level level, String format, Object... arguments) {
		log(level, null, format, arguments);
	}
37299
private static void setJULLevel( java.util.logging.Logger logger, String log4jLevelConfig )
    {
        java.util.logging.Level level = log4jLevelToJULLevel( log4jLevelConfig );
        logger.setLevel( level );
    }
599957
public void setLoggerLevel(String level) {
        if ("TRACE".equalsIgnoreCase(level)) {
            this.level = TRACE;
        } else if ("DEBUG".equalsIgnoreCase(level)) {
            this.level = DEBUG;
        } else if ("INFO".equalsIgnoreCase(level)) {
            this.level = INFO;
        } else if ("WARN".equalsIgnoreCase(level)) {
            this.level = WARN;
        } else if ("ERROR".equalsIgnoreCase(level)) {
            this.level = ERROR;
        }
    }
202605
public static LoggerConfig[] setLogLevel(String loggerName, String level) {
    if(StringUtils.isBlank(loggerName)) {
      loggerName = ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME;
    }
    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
    log.debug("Setting {} to level {}", loggerName, level);
    ch.qos.logback.classic.Logger logger = null;
    try {
      logger = context.getLogger(loggerName);
      if(logger != null) {
        if(level.equals("null") || level.equals("none")) {
          logger.setLevel(null);
        } else {
          logger.setLevel(Level.toLevel(level));
        }
        logger = context.getLogger(loggerName);
        return new LoggerConfig[] {new LoggerConfig(logger.getName(), logger.getLevel() + "")};
      }
      return new LoggerConfig[] {};
    } catch(Throwable t) {
      log.warn("Failed to change log level for logger "+loggerName+" to level "+level, t);
      return new LoggerConfig[] {};
    }
  }
1343289
@Deprecated
    public int getLevel() {
        Level level = loggerProxy.getLevel();
        return level != null ? level.intValue() : 0;
    }
1337533
def logging_level(level):
    
    level = level.upper()
    levels = [DEBUG, INFO, WARNING, ERROR, CRITICAL, VERBOSE]
    level_names = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL', 'VERBOSE']

    if level not in level_names:
        raise Exception("Level %r not in %r" % (level, levels))

    param_logger = get_logger()
    logging_level = param_logger.getEffectiveLevel()
    param_logger.setLevel(levels[level_names.index(level)])
    try:
        yield None
    finally:
        param_logger.setLevel(logging_level)
397641
@Override
    protected void logImpl(LogLevel level,Object[] message,Throwable throwable)
    {
        //get log level
        int levelValue=level.getValue();
        Level jdkLevel=null;
        switch(levelValue)
        {
            case LogLevel.DEBUG_LOG_LEVEL_VALUE:
                jdkLevel=Level.FINEST;
                break;
            case LogLevel.ERROR_LOG_LEVEL_VALUE:
                jdkLevel=Level.SEVERE;
                break;
            case LogLevel.INFO_LOG_LEVEL_VALUE:
            default:
                jdkLevel=Level.FINE;
                break;
        }

        if(jdkLevel!=null)
        {
            //format log message (without exception)
            String text=this.formatLogMessage(level,message,null);

            //log
            this.JDK_LOGGER.log(jdkLevel,text,throwable);
        }
    }
495210
public boolean isLoggable(Level level) {
        if (level == null) {
            throw new NullPointerException();
        }
        // performance-sensitive method: use two monomorphic call-sites
        JavaLoggerProxy jlp = javaLoggerProxy;
        return jlp != null ? jlp.isLoggable(level) : loggerProxy.isLoggable(level);
    }
513893
private static Level translateLevel(final int level) {
		if (level <= TRACE_INT) {
			return Level.TRACE;
		} else if (level <= DEBUG_INT) {
			return Level.DEBUG;
		} else if (level <= INFO_INT) {
			return Level.INFO;
		} else if (level <= WARN_INT) {
			return Level.WARN;
		} else {
			return Level.ERROR;
		}
	}
849692
public void setLevel(@NonNull LogLevel level) {
        if (config == null) {
            throw new IllegalStateException("Cannot set logging level without a configuration");
        }

        if (logLevel.equals(level)) {
            return;
        }

        logLevel = level;
        C4Log.setBinaryFileLevel(level.getValue());
    }
562189
def logger_level=(level)
      logger.level = LOGGER_LEVEL[level] if LOGGER_LEVEL.key?(level)
      logger
    end
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())
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)
954437
def set_log_level(logger_name: str, log_level: str, propagate: bool = False):
    """"""
    log = logging.getLogger(logger_name)
    log.propagate = propagate
    log.setLevel(log_level)
1118227
public static Level getJavaUtilLoggingLevelFor(final Log mavenLog) {

        // Check sanity
        Validate.notNull(mavenLog, "mavenLog");

        Level toReturn = Level.SEVERE;

        if (mavenLog.isDebugEnabled()) {
            toReturn = Level.FINER;
        } else if (mavenLog.isInfoEnabled()) {
            toReturn = Level.INFO;
        } else if (mavenLog.isWarnEnabled()) {
            toReturn = Level.WARNING;
        }

        // All Done.
        return toReturn;
    }
618465
public void log(Level level, Object message) {
        doLog(level, FQCN, message, null, null);
    }