Java Code Examples for java.util.logging.Level.intValue()

The following are Jave code examples for showing how to use intValue() of the java.util.logging.Level class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: OKEventBus   File: AndroidLogger.java   View Source Code Vote up 6 votes
private int mapLevel(Level level) {
    int value = level.intValue();
    if (value < 800) { // below INFO
        if (value < 500) { // below FINE
            return Log.VERBOSE;
        } else {
            return Log.DEBUG;
        }
    } else if (value < 900) { // below WARNING
        return Log.INFO;
    } else if (value < 1000) { // below ERROR
        return Log.WARN;
    } else {
        return Log.ERROR;
    }
}
 
Example 2
Project: openjdk-jdk10   File: TestIsLoggable.java   View Source Code Vote up 5 votes
@Override
public boolean isLoggable(Level level) {
    final Level threadLevel = threadMap.get(Thread.currentThread().getId());
    if (threadLevel == null) return super.isLoggable(level);
    final int levelValue = threadLevel.intValue();
    final int offValue = Level.OFF.intValue();
    if (level.intValue() < levelValue || levelValue == offValue) {
        return false;
    }
    return true;
}
 
Example 3
Project: shtrih-m   File: BuildInfo.java   View Source Code Vote up 4 votes
private static boolean isLogFinest(){
    Level ll = logLevel();
    return ll == null
        ? false
        : ll.intValue() <= Level.FINEST.intValue();
}
 
Example 4
Project: shtrih-m   File: ShtrihMJacobDriver.java   View Source Code Vote up 4 votes
private static boolean isLogWarning(){
    Level ll = logLevel();
    return ll == null
        ? true
        : ll.intValue() <= Level.WARNING.intValue();
}
 
Example 5
Project: shtrih-m   File: ShtrihMFunRes.java   View Source Code Vote up 4 votes
private static boolean isLogSevere(){
    Level ll = logLevel();
    return ll == null
        ? true
        : ll.intValue() <= Level.SEVERE.intValue();
}
 
Example 6
Project: shtrih-m   File: ThreadSafeDriver.java   View Source Code Vote up 4 votes
private static boolean isLogFinest(){
    Level ll = logLevel();
    return ll == null
        ? false
        : ll.intValue() <= Level.FINEST.intValue();
}
 
Example 7
Project: shtrih-m   File: Task.java   View Source Code Vote up 4 votes
private static boolean isLogInfo(){
    Level ll = logLevel();
    return ll == null
        ? true
        : ll.intValue() <= Level.INFO.intValue();
}
 
Example 8
Project: shtrih-m   File: SaleResult.java   View Source Code Vote up 4 votes
private static boolean isLogFine(){
    Level ll = logLevel();
    return ll == null
        ? true
        : ll.intValue() <= Level.FINE.intValue();
}
 
Example 9
Project: shtrih-m   File: StateCompare.java   View Source Code Vote up 4 votes
private static boolean isLogInfo(){
    Level ll = logLevel();
    return ll == null
        ? true
        : ll.intValue() <= Level.INFO.intValue();
}
 
Example 10
Project: shtrih-m   File: ShtrihMFunRes.java   View Source Code Vote up 4 votes
private static boolean isLogFine(){
    Level ll = logLevel();
    return ll == null
        ? true
        : ll.intValue() <= Level.FINE.intValue();
}
 
Example 11
Project: shtrih-m   File: SaleResult.java   View Source Code Vote up 4 votes
private static boolean isLogFinest(){
    Level ll = logLevel();
    return ll == null
        ? false
        : ll.intValue() <= Level.FINEST.intValue();
}
 
Example 12
Project: shtrih-m   File: StateCompare.java   View Source Code Vote up 4 votes
private static boolean isLogFine(){
    Level ll = logLevel();
    return ll == null
        ? true
        : ll.intValue() <= Level.FINE.intValue();
}
 
Example 13
Project: marathonv5   File: Session.java   View Source Code Vote up 4 votes
public void log(Level level, String message) {
    if (level.intValue() >= logLevel.intValue()) {
        logEntries.add(new LogEntry(level, message));
    }
}
 
Example 14
Project: ats-framework   File: JavaLoggingAdapter.java   View Source Code Vote up 4 votes
@Override
public void publish(
                     LogRecord record ) {

    Level level = record.getLevel();
    String message = record.getMessage();
    if (level.intValue() == Level.ALL.intValue()) {
        throw new RuntimeException("ALL");
    }

    if (level.intValue() <= Level.FINEST.intValue()) {
        logger.debug(message);
        return;//300
    }

    if (level.intValue() <= Level.FINE.intValue()) {
        logger.debug(message);
        return;//500
    }

    if (level.intValue() <= Level.CONFIG.intValue()) {
        logger.debug(message);
        return;//700
    }

    if (level.intValue() <= Level.INFO.intValue()) {
        logger.info(message);
        return;//800
    }

    if (level.intValue() <= Level.WARNING.intValue()) {
        logger.warn(message);
        return;//900
    }

    if (level.intValue() <= Level.SEVERE.intValue()) {
        logger.error(message);
        return;//1000
    }

    if (level.intValue() <= Level.OFF.intValue()) {
        throw new RuntimeException("OFF");
    }

}
 
Example 15
Project: shtrih-m   File: ECRMode.java   View Source Code Vote up 4 votes
private static boolean isLogFinest(){
    Level ll = logLevel();
    return ll == null
        ? false
        : ll.intValue() <= Level.FINEST.intValue();
}
 
Example 16
Project: shtrih-m   File: Task.java   View Source Code Vote up 4 votes
private static boolean isLogFine(){
    Level ll = logLevel();
    return ll == null
        ? true
        : ll.intValue() <= Level.FINE.intValue();
}
 
Example 17
Project: devtools-driver   File: IOSLogManager.java   View Source Code Vote up 4 votes
public IOSLogManager(LoggingPreferences prefs) {
  Level perfLevel = prefs.getLevel(LogType.PERFORMANCE);
  if (perfLevel.intValue() < Level.OFF.intValue()) {
    logs.put(LogType.PERFORMANCE, new WebDriverLog(LogType.PERFORMANCE, perfLevel));
  }
}
 
Example 18
Project: shtrih-m   File: SaleResult.java   View Source Code Vote up 4 votes
private static boolean isLogFiner(){
    Level ll = logLevel();
    return ll == null
        ? false
        : ll.intValue() <= Level.FINER.intValue();
}
 
Example 19
Project: shtrih-m   File: ShtrihMFun.java   View Source Code Vote up 4 votes
private static boolean isLogWarning(){
    Level ll = logLevel();
    return ll == null
        ? true
        : ll.intValue() <= Level.WARNING.intValue();
}
 
Example 20
Project: OpenJSharp   File: DebugLogger.java   View Source Code Vote up 2 votes
/**
 * Check if the logger is above or equal to the level
 * of detail given
 * @see java.util.logging.Level
 *
 * The higher the level, the more severe the warning
 *
 * @param level logging level
 * @return true if level is above the given one
 */
public boolean levelCoarserThanOrEqual(final Level level) {
    return getLevel().intValue() >= level.intValue();
}