当前位置: 首页>>代码示例>>Java>>正文


Java Level.OFF属性代码示例

本文整理汇总了Java中java.util.logging.Level.OFF属性的典型用法代码示例。如果您正苦于以下问题:Java Level.OFF属性的具体用法?Java Level.OFF怎么用?Java Level.OFF使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.util.logging.Level的用法示例。


在下文中一共展示了Level.OFF属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerBuffer

public static Test registerBuffer(Level msg, Level exc) {
    if (msg == null) {
        msg = Level.OFF;
    }
    if (exc == null) {
        exc = Level.OFF;
    }

    if (exc == Level.OFF && msg == Level.OFF) {
        return null;
    }

    NbModuleLogHandler.msg = msg;
    NbModuleLogHandler.exc = exc;
    NbModuleLogHandler.text = new StringBuffer();
    Logger l = Logger.getLogger("");
    Level min = msg;
    if (min.intValue() > exc.intValue()) {
        min = exc;
    }
    l.setLevel(min);
    return new FailOnException(msg, exc);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:NbModuleLogHandler.java

示例2: getLogLevel

static private Level getLogLevel(int level) {
	switch (level) {
	case 0:
		return Level.OFF;
	case 1:
		return Level.WARNING;
	case 2:
		return Level.INFO;
	case 3:
		return Level.FINE;
	case 4:
		return Level.FINER;
	case 9:
		return Level.ALL;
	default:
		return Level.FINEST;
	}
}
 
开发者ID:wfink,项目名称:jboss-eap7.1-playground,代码行数:18,代码来源:AbstractLoggerMain.java

示例3: getLog

/**
 * Access log for a tri-state system property.
 *
 * Need to first convert override value to a log level, taking
 * care to interpret a range of values between BRIEF, VERBOSE and
 * SILENT.
 *
 * An override < 0 is interpreted to mean that the logging
 * configuration should not be overridden. The level passed to the
 * factories createLog method will be null in this case.
 *
 * Note that if oldLogName is null and old logging is on, the
 * returned LogStreamLog will ignore the override parameter - the
 * log will never log messages.  This permits new logs that only
 * write to Loggers to do nothing when old logging is active.
 *
 * Do not call getLog multiple times on the same logger name.
 * Since this is an internal API, no checks are made to ensure
 * that multiple logs do not exist for the same logger.
 */
public static Log getLog(String loggerName, String oldLogName,
                         int override)
{
    Level level;

    if (override < 0) {
        level = null;
    } else if (override == LogStream.SILENT) {
        level = Level.OFF;
    } else if ((override > LogStream.SILENT) &&
               (override <= LogStream.BRIEF)) {
        level = BRIEF;
    } else if ((override > LogStream.BRIEF) &&
               (override <= LogStream.VERBOSE))
    {
        level = VERBOSE;
    } else {
        level = Level.FINEST;
    }
    return logFactory.createLog(loggerName, oldLogName, level);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:Log.java

示例4: randomLevel

private static Level randomLevel(Random r) {
    int lev = r.nextInt(1100);
    if (lev >= Level.SEVERE.intValue()) return Level.SEVERE;
    if (lev >= Level.WARNING.intValue()) return Level.WARNING;
    if (lev >= Level.INFO.intValue()) return Level.INFO;
    if (lev >= Level.CONFIG.intValue()) return Level.CONFIG;
    if (lev >= Level.FINE.intValue()) return Level.FINE;
    if (lev >= Level.FINER.intValue()) return Level.FINER;
    if (lev >= Level.FINEST.intValue()) return Level.FINEST;
    return Level.OFF;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:LogRecordsTest.java

示例5: threshold

public Level threshold() {
    for (Level l : LEVELS ) {
        if (this.toString().endsWith(l.getName())) {
            return l;
        }
    }
    return Level.OFF;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:TestIsLoggable.java

示例6: close

@Override
public void close() {
    Logger l = this.logger;
    if (getLevel() != Level.OFF && l != null) {
        l.addHandler(this);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:Log.java

示例7: getLogLevel

/**
 * Gdx to Log4j log level mapping
 */
private static Level getLogLevel(int logLevel) {
    switch (logLevel) {
        case Application.LOG_NONE:
            return Level.OFF;
        case Application.LOG_ERROR:
            return Level.SEVERE;
        case Application.LOG_INFO:
            return Level.INFO;
        case Application.LOG_DEBUG:
            return Level.FINEST;
        default:
            return Level.ALL;
    }
}
 
开发者ID:MrStahlfelge,项目名称:gdx-gamesvcs,代码行数:17,代码来源:GpgsClient.java

示例8: forEnclosingClass

/** Returns a generic fluent logger for a class. */
public static FluentLogger forEnclosingClass() {
  StackTraceElement caller = new Throwable().getStackTrace()[1];
  Logger logger = Logger.getLogger(caller.getClassName());
  logger.setUseParentHandlers(false);
  logger.addHandler(new ConsoleHandler());
  return new FluentLogger(logger, Level.OFF, Optional.empty());
}
 
开发者ID:google,项目名称:ios-device-control,代码行数:8,代码来源:FluentLogger.java

示例9: log

@Override
public void log(Level level, String msg, Throwable th) {
    if (level != Level.OFF) {
        // That's how Log does it internally
        Log.println(mapLevel(level), tag, msg + "\n" + Log.getStackTraceString(th));
    }
}
 
开发者ID:AweiLoveAndroid,项目名称:OKEventBus,代码行数:7,代码来源:AndroidLogger.java

示例10: logLevel

@Override
protected Level logLevel() {
    return Level.OFF;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:LogTest.java

示例11: getLevel

@Override
public Level getLevel() {
    return willLog() ? Level.FINEST : Level.OFF;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:StartLog.java

示例12: getLogLevel

public Level getLogLevel() {
    return Level.OFF;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:3,代码来源:MapEnvelopeTask.java

示例13: getLogLevel

protected Level getLogLevel() {
	if (log.getLevel() == Level.ALL) return Level.FINEST;
	if (log.getLevel() == Level.OFF) return Level.WARNING;
	if (log.getLevel() == Level.CONFIG) return Level.WARNING;
	return log.getLevel();
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:6,代码来源:BaseTest.java

示例14: getLevel

/**
 * Do not currently support chaining this with parent logger. Logger level null
 * means disabled
 * @return level
 */
public Level getLevel() {
    return logger.getLevel() == null ? Level.OFF : logger.getLevel();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:DebugLogger.java


注:本文中的java.util.logging.Level.OFF属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。