當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。