Java Code Examples for java.lang.System.Logger#Level

The following examples show how to use java.lang.System.Logger#Level . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestLoggerFinder.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public static LogEvent of(long sequenceNumber,
        boolean isLoggable, String name,
        Logger.Level level, ResourceBundle bundle,
        String key, Supplier<String> supplier,
        Throwable thrown, Object... params) {
    LogEvent evt = new LogEvent(sequenceNumber);
    evt.loggerName = name;
    evt.level = level;
    evt.args = params;
    evt.bundle = bundle;
    evt.thrown = thrown;
    evt.supplier = supplier;
    evt.msg = key;
    evt.isLoggable = isLoggable;
    return evt;
}
 
Example 2
Source File: TestLoggerFinder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static LogEvent of(boolean isLoggable, String name,
        Logger.Level level, ResourceBundle bundle,
        String key, Throwable thrown) {
    LogEvent evt = new LogEvent();
    evt.isLoggable = isLoggable;
    evt.loggerName = name;
    evt.level = level;
    evt.args = null;
    evt.bundle = bundle;
    evt.thrown = thrown;
    evt.supplier = null;
    evt.msg = key;
    return evt;
}
 
Example 3
Source File: TestLoggerFinder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static LogEvent of(boolean isLoggable, String name,
        Logger.Level level, ResourceBundle bundle,
        String key, Object... params) {
    LogEvent evt = new LogEvent();
    evt.isLoggable = isLoggable;
    evt.loggerName = name;
    evt.level = level;
    evt.args = params;
    evt.bundle = bundle;
    evt.thrown = null;
    evt.supplier = null;
    evt.msg = key;
    return evt;
}
 
Example 4
Source File: TestLoggerFinder.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public boolean isLoggable(Logger.Level level) {
    return this.level != Logger.Level.OFF && this.level.getSeverity() <= level.getSeverity();
}
 
Example 5
Source File: TestLoggerFinder.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void log(Logger.Level level, ResourceBundle bundle, String key, Throwable thrown) {
    log(LogEvent.of(isLoggable(level), this.name, level, bundle, key, thrown));
}
 
Example 6
Source File: TestLoggerFinder.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void log(Logger.Level level, ResourceBundle bundle, String format, Object... params) {
    log(LogEvent.of(isLoggable(level), name, level, bundle, format, params));
}
 
Example 7
Source File: LoggerFinderLoaderTest.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public boolean isLoggable(Logger.Level level) {
    return logger.isLoggable(level);
}
 
Example 8
Source File: LoggerFinderLoaderTest.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void log(Logger.Level level, ResourceBundle bundle, String key, Throwable thrown) {
    logger.log(level, bundle, key, thrown);
}
 
Example 9
Source File: LoggerFinderLoaderTest.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void log(Logger.Level level, ResourceBundle bundle, String format, Object... params) {
    logger.log(level, bundle, format, params);
}