/** * Returns the implementation to use for the logger of the specified name, * or {@code null} if the logger would delegates to Java logging anyway. */ @Override protected DualLogger getImplementation(final String name) { return new DualLogger(name, first.getLogger(name), second.getLogger(name)); }
/** * Returns the logger of the specified name, or {@code null} if the JDK logging framework * should be used. * * @param name the name of the logger. * @return the logger, or {@code null} if the JDK logging framework should be used. */ public Logger getLogger(final String name) { final L target = getImplementation(name); if (target == null) { return null; } synchronized (loggers) { Logger logger = loggers.get(name); if (logger == null || !target.equals(unwrap(logger))) { logger = wrap(name, target); loggers.put(name, logger); } return logger; } }
/** * Returns the logger of the specified name, or {@code null} if the JDK logging framework * should be used. * * @param name the name of the logger. * @return the logger, or {@code null} if the JDK logging framework should be used. */ public Logger getLogger(final String name) { final L target = getImplementation(name); if (target == null) { return null; } synchronized (loggers) { Logger logger = loggers.get(name); if (logger == null || !target.equals(unwrap(logger))) { logger = wrap(name, target); loggers.put(name, logger); } return logger; } }
/** * Returns the implementation to use for the logger of the specified name, * or {@code null} if the logger would delegates to Java logging anyway. */ @Override protected DualLogger getImplementation(final String name) { return new DualLogger(name, first.getLogger(name), second.getLogger(name)); }
/** * Returns a logger for the specified name. If a {@linkplain LoggerFactory logger factory} has been set, * then this method first {@linkplain LoggerFactory#getLogger(String) asks to the factory}. * This rule gives SIS a chance to redirect logging events to * <a href="http://commons.apache.org/logging/">commons-logging</a> or some equivalent framework. * Only if no factory was found or if the factory choose to not redirect the loggings, then this * method delegate to <code>{@linkplain Logger#getLogger(String) Logger.getLogger}(name)</code>. * * @param name the logger name. * @return a logger for the specified name. */ public static Logger getLogger(final String name) { final LoggerFactory<?> factory = Logging.factory; if (factory != null) { final Logger logger = factory.getLogger(name); if (logger != null) { return logger; } } return Logger.getLogger(name); }
nameKey = Vocabulary.Keys.Implementation; final LoggerFactory<?> factory = Logging.getLoggerFactory(); value = (factory != null) ? factory.getName() : "java.util.logging";
/** * Returns a logger for the specified name. If a {@linkplain LoggerFactory logger factory} has been set, * then this method first {@linkplain LoggerFactory#getLogger(String) asks to the factory}. * This rule gives SIS a chance to redirect logging events to * <a href="http://commons.apache.org/logging/">commons-logging</a> or some equivalent framework. * Only if no factory was found or if the factory choose to not redirect the loggings, then this * method delegate to <code>{@linkplain Logger#getLogger(String) Logger.getLogger}(name)</code>. * * @param name the logger name. * @return a logger for the specified name. */ public static Logger getLogger(final String name) { final LoggerFactory<?> factory = Logging.factory; if (factory != null) { final Logger logger = factory.getLogger(name); if (logger != null) { return logger; } } return Logger.getLogger(name); }
nameKey = Vocabulary.Keys.Implementation; final LoggerFactory<?> factory = Logging.getLoggerFactory(); value = (factory != null) ? factory.getName() : "java.util.logging";