Java 类jdk.nashorn.internal.runtime.options.LoggingOption.LoggerInfo 实例源码

项目:openjdk9    文件:Context.java   
/**
 * Get a logger, given a loggable class
 * @param clazz a Loggable class
 * @param initHook an init hook - if this is the first time the logger is created in the context, run the init hook
 * @return debuglogger associated with that class
 */
public DebugLogger getLogger(final Class<? extends Loggable> clazz, final Consumer<DebugLogger> initHook) {
    final String name = getLoggerName(clazz);
    DebugLogger logger = loggers.get(name);
    if (logger == null) {
        if (!env.hasLogger(name)) {
            return DebugLogger.DISABLED_LOGGER;
        }
        final LoggerInfo info = env._loggers.get(name);
        logger = new DebugLogger(name, info.getLevel(), info.isQuiet());
        if (initHook != null) {
            initHook.accept(logger);
        }
        loggers.put(name, logger);
    }
    return logger;
}
项目:kaziranga    文件:Context.java   
/**
 * Get a logger, given a loggable class
 * @param clazz a Loggable class
 * @param initHook an init hook - if this is the first time the logger is created in the context, run the init hook
 * @return debuglogger associated with that class
 */
public DebugLogger getLogger(final Class<? extends Loggable> clazz, final Consumer<DebugLogger> initHook) {
    final String name = getLoggerName(clazz);
    DebugLogger logger = loggers.get(name);
    if (logger == null) {
        if (!env.hasLogger(name)) {
            return DebugLogger.DISABLED_LOGGER;
        }
        final LoggerInfo info = env._loggers.get(name);
        logger = new DebugLogger(name, info.getLevel(), info.isQuiet());
        if (initHook != null) {
            initHook.accept(logger);
        }
        loggers.put(name, logger);
    }
    return logger;
}
项目:lookaside_java-1.8.0-openjdk    文件:Context.java   
/**
 * Get a logger, given a loggable class
 * @param clazz a Loggable class
 * @param initHook an init hook - if this is the first time the logger is created in the context, run the init hook
 * @return debuglogger associated with that class
 */
public DebugLogger getLogger(final Class<? extends Loggable> clazz, final Consumer<DebugLogger> initHook) {
    final String name = getLoggerName(clazz);
    DebugLogger logger = loggers.get(name);
    if (logger == null) {
        if (!env.hasLogger(name)) {
            return DebugLogger.DISABLED_LOGGER;
        }
        final LoggerInfo info = env._loggers.get(name);
        logger = new DebugLogger(name, info.getLevel(), info.isQuiet());
        if (initHook != null) {
            initHook.accept(logger);
        }
        loggers.put(name, logger);
    }
    return logger;
}
项目:jdk8u_nashorn    文件:Context.java   
/**
 * Get a logger, given a loggable class
 * @param clazz a Loggable class
 * @param initHook an init hook - if this is the first time the logger is created in the context, run the init hook
 * @return debuglogger associated with that class
 */
public DebugLogger getLogger(final Class<? extends Loggable> clazz, final Consumer<DebugLogger> initHook) {
    final String name = getLoggerName(clazz);
    DebugLogger logger = loggers.get(name);
    if (logger == null) {
        if (!env.hasLogger(name)) {
            return DebugLogger.DISABLED_LOGGER;
        }
        final LoggerInfo info = env._loggers.get(name);
        logger = new DebugLogger(name, info.getLevel(), info.isQuiet());
        if (initHook != null) {
            initHook.accept(logger);
        }
        loggers.put(name, logger);
    }
    return logger;
}
项目:infobip-open-jdk-8    文件:Context.java   
/**
 * Get a logger, given a loggable class
 * @param clazz a Loggable class
 * @param initHook an init hook - if this is the first time the logger is created in the context, run the init hook
 * @return debuglogger associated with that class
 */
public DebugLogger getLogger(final Class<? extends Loggable> clazz, final Consumer<DebugLogger> initHook) {
    final String name = getLoggerName(clazz);
    DebugLogger logger = loggers.get(name);
    if (logger == null) {
        if (!env.hasLogger(name)) {
            return DebugLogger.DISABLED_LOGGER;
        }
        final LoggerInfo info = env._loggers.get(name);
        logger = new DebugLogger(name, info.getLevel(), info.isQuiet());
        if (initHook != null) {
            initHook.accept(logger);
        }
        loggers.put(name, logger);
    }
    return logger;
}