本文整理匯總了Java中java.util.logging.Level.intValue方法的典型用法代碼示例。如果您正苦於以下問題:Java Level.intValue方法的具體用法?Java Level.intValue怎麽用?Java Level.intValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.logging.Level
的用法示例。
在下文中一共展示了Level.intValue方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: mapLevel
import java.util.logging.Level; //導入方法依賴的package包/類
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;
}
}
示例2: isLoggable
import java.util.logging.Level; //導入方法依賴的package包/類
@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;
}
示例3: isLogFinest
import java.util.logging.Level; //導入方法依賴的package包/類
private static boolean isLogFinest(){
Level ll = logLevel();
return ll == null
? false
: ll.intValue() <= Level.FINEST.intValue();
}
示例4: isLogWarning
import java.util.logging.Level; //導入方法依賴的package包/類
private static boolean isLogWarning(){
Level ll = logLevel();
return ll == null
? true
: ll.intValue() <= Level.WARNING.intValue();
}
示例5: isLogSevere
import java.util.logging.Level; //導入方法依賴的package包/類
private static boolean isLogSevere(){
Level ll = logLevel();
return ll == null
? true
: ll.intValue() <= Level.SEVERE.intValue();
}
示例6: isLogInfo
import java.util.logging.Level; //導入方法依賴的package包/類
private static boolean isLogInfo(){
Level ll = logLevel();
return ll == null
? true
: ll.intValue() <= Level.INFO.intValue();
}
示例7: isLogFine
import java.util.logging.Level; //導入方法依賴的package包/類
private static boolean isLogFine(){
Level ll = logLevel();
return ll == null
? true
: ll.intValue() <= Level.FINE.intValue();
}
示例8: log
import java.util.logging.Level; //導入方法依賴的package包/類
public void log(Level level, String message) {
if (level.intValue() >= logLevel.intValue()) {
logEntries.add(new LogEntry(level, message));
}
}
示例9: publish
import java.util.logging.Level; //導入方法依賴的package包/類
@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");
}
}
示例10: IOSLogManager
import java.util.logging.Level; //導入方法依賴的package包/類
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));
}
}
示例11: isLogFiner
import java.util.logging.Level; //導入方法依賴的package包/類
private static boolean isLogFiner(){
Level ll = logLevel();
return ll == null
? false
: ll.intValue() <= Level.FINER.intValue();
}
示例12: levelCoarserThanOrEqual
import java.util.logging.Level; //導入方法依賴的package包/類
/**
* 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();
}