@Override public ExtendedLogger getLogger(final String name, final MessageFactory messageFactory) { // Note: This is the only method where we add entries to the 'loggerRegistry' ivar. final ExtendedLogger extendedLogger = loggerRegistry.getLogger(name, messageFactory); if (extendedLogger != null) { AbstractLogger.checkMessageFactory(extendedLogger, messageFactory); return extendedLogger; } final SimpleLogger simpleLogger = new SimpleLogger(name, defaultLevel, showLogName, showShortName, showDateTime, showContextMap, dateTimeFormat, messageFactory, props, stream); loggerRegistry.putIfAbsent(name, messageFactory, simpleLogger); return loggerRegistry.getLogger(name, messageFactory); }
public Collection<T> getLoggers() { return getLoggers(new ArrayList<T>()); }
/** * Detects if a Logger with the specified name and MessageFactory type exists. * @param name The Logger name to search for. * @param messageFactoryClass The message factory class to search for. * @return true if the Logger exists, false otherwise. * @since 2.5 */ public boolean hasLogger(final String name, final Class<? extends MessageFactory> messageFactoryClass) { return getOrCreateInnerMap(factoryClassKey(messageFactoryClass)).containsKey(name); }
/** * Detects if a Logger with the specified name and MessageFactory exists. * @param name The Logger name to search for. * @param messageFactory The message factory to search for. * @return true if the Logger exists, false otherwise. * @since 2.5 */ public boolean hasLogger(final String name, final MessageFactory messageFactory) { return getOrCreateInnerMap(factoryKey(messageFactory)).containsKey(name); }
/** * Detects if a Logger with the specified name exists. * @param name The Logger name to search for. * @return true if the Logger exists, false otherwise. */ public boolean hasLogger(final String name) { return getOrCreateInnerMap(DEFAULT_FACTORY_KEY).containsKey(name); }
/** * Determines if the specified Logger exists. * * @param name The Logger name to search for. * @return True if the Logger exists, false otherwise. */ @Override public boolean hasLogger(final String name, final Class<? extends MessageFactory> messageFactoryClass) { return loggerRegistry.hasLogger(name, messageFactoryClass); }
/** * Returns an ExtendedLogger. * @param name The name of the Logger to return. * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change * the logger but will log a warning if mismatched. * @return The logger with the specified name. */ public T getLogger(final String name, final MessageFactory messageFactory) { return getOrCreateInnerMap(factoryKey(messageFactory)).get(name); }
/** * Returns an ExtendedLogger. * @param name The name of the Logger to return. * @return The logger with the specified name. */ public T getLogger(final String name) { return getOrCreateInnerMap(DEFAULT_FACTORY_KEY).get(name); }
/** * Determines if the specified Logger exists. * * @param name The Logger name to search for. * @return True if the Logger exists, false otherwise. */ @Override public boolean hasLogger(final String name) { return loggerRegistry.hasLogger(name); }
@Override public ExtendedLogger getLogger(final String name, final MessageFactory messageFactory) { // Note: This is the only method where we add entries to the 'loggerRegistry' ivar. final ExtendedLogger extendedLogger = loggerRegistry.getLogger(name, messageFactory); if (extendedLogger != null) { AbstractLogger.checkMessageFactory(extendedLogger, messageFactory); return extendedLogger; } final SimpleLogger simpleLogger = new SimpleLogger(name, defaultLevel, showLogName, showShortName, showDateTime, showContextMap, dateTimeFormat, messageFactory, props, stream); loggerRegistry.putIfAbsent(name, messageFactory, simpleLogger); return loggerRegistry.getLogger(name, messageFactory); }
public void putIfAbsent(final String name, final MessageFactory messageFactory, final T logger) { factory.putIfAbsent(getOrCreateInnerMap(factoryKey(messageFactory)), name, logger); } }
/** * Gets a collection of the current loggers. * <p> * Whether this collection is a copy of the underlying collection or not is undefined. Therefore, modify this * collection at your own risk. * </p> * * @return a collection of the current loggers. */ public Collection<Logger> getLoggers() { return loggerRegistry.getLoggers(); }
/** * Detects if a Logger with the specified name and MessageFactory type exists. * @param name The Logger name to search for. * @param messageFactoryClass The message factory class to search for. * @return true if the Logger exists, false otherwise. * @since 2.5 */ public boolean hasLogger(final String name, final Class<? extends MessageFactory> messageFactoryClass) { return getOrCreateInnerMap(factoryClassKey(messageFactoryClass)).containsKey(name); }
/** * Returns an ExtendedLogger. * @param name The name of the Logger to return. * @return The logger with the specified name. */ public T getLogger(final String name) { return getOrCreateInnerMap(DEFAULT_FACTORY_KEY).get(name); }
/** * Determines if the specified Logger exists. * * @param name The Logger name to search for. * @return True if the Logger exists, false otherwise. */ @Override public boolean hasLogger(final String name, final MessageFactory messageFactory) { return loggerRegistry.hasLogger(name, messageFactory); }
/** * Obtains a Logger from the Context. * * @param name The name of the Logger to return. * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change the * logger but will log a warning if mismatched. * @return The Logger. */ @Override public Logger getLogger(final String name, final MessageFactory messageFactory) { // Note: This is the only method where we add entries to the 'loggerRegistry' ivar. Logger logger = loggerRegistry.getLogger(name, messageFactory); if (logger != null) { AbstractLogger.checkMessageFactory(logger, messageFactory); return logger; } logger = newInstance(this, name, messageFactory); loggerRegistry.putIfAbsent(name, messageFactory, logger); return loggerRegistry.getLogger(name, messageFactory); }
/** * Returns an ExtendedLogger. * @param name The name of the Logger to return. * @param messageFactory The message factory is used only when creating a logger, subsequent use does not change * the logger but will log a warning if mismatched. * @return The logger with the specified name. */ public T getLogger(final String name, final MessageFactory messageFactory) { return getOrCreateInnerMap(factoryKey(messageFactory)).get(name); }
public Collection<T> getLoggers() { return getLoggers(new ArrayList<T>()); }
/** * Detects if a Logger with the specified name exists. * @param name The Logger name to search for. * @return true if the Logger exists, false otherwise. */ public boolean hasLogger(final String name) { return getOrCreateInnerMap(DEFAULT_FACTORY_KEY).containsKey(name); }
/** * Detects if a Logger with the specified name and MessageFactory exists. * @param name The Logger name to search for. * @param messageFactory The message factory to search for. * @return true if the Logger exists, false otherwise. * @since 2.5 */ public boolean hasLogger(final String name, final MessageFactory messageFactory) { return getOrCreateInnerMap(factoryKey(messageFactory)).containsKey(name); }