Class LoggerRegistry<T extends ExtendedLogger>
ExtendedLogger registry by LoggerContext implementations.- Since:
- 2.6
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.static interfaceLoggerRegistry.MapFactory<T extends ExtendedLogger>Deprecated.As of version2.25.0, planned to be removed!static classLoggerRegistry.WeakMapFactory<T extends ExtendedLogger>Deprecated.As of version2.25.0, planned to be removed! -
Constructor Summary
ConstructorsConstructorDescriptionLoggerRegistry(@Nullable LoggerRegistry.MapFactory<T> mapFactory) Deprecated.As of version2.25.0, planned to be removed! -
Method Summary
Modifier and TypeMethodDescription@Nullable TDeprecated.As of version2.25.0, planned to be removed!@Nullable TgetLogger(String name, @Nullable MessageFactory messageFactory) Returns the logger associated with the given name and message factory.getLoggers(Collection<T> destination) booleanDeprecated.As of version2.25.0, planned to be removed!booleanhasLogger(String name, @Nullable MessageFactory messageFactory) Checks if a logger associated with the given name and message factory exists.booleanhasLogger(String name, Class<? extends MessageFactory> messageFactoryClass) Checks if a logger associated with the given name and message factory type exists.voidputIfAbsent(String name, @Nullable MessageFactory messageFactory, T logger) Registers the provided logger.
-
Constructor Details
-
LoggerRegistry
public LoggerRegistry() -
LoggerRegistry
Deprecated.As of version2.25.0, planned to be removed!Constructs an instance ignoring the given the map factory.- Parameters:
mapFactory- a map factory
-
-
Method Details
-
getLogger
Deprecated.As of version2.25.0, planned to be removed! UsegetLogger(String, MessageFactory)instead.Returns the logger associated with the given name.There can be made no assumptions on the message factory of the returned logger. Callers are strongly advised to switch to
getLogger(String, MessageFactory)and provide a message factory parameter!- Parameters:
name- a logger name- Returns:
- the logger associated with the name
-
getLogger
Returns the logger associated with the given name and message factory.In the absence of a message factory, there can be made no assumptions on the message factory of the returned logger. This lenient behaviour is only kept for backward compatibility. Callers are strongly advised to provide a message factory parameter to the method!
- Parameters:
name- a logger namemessageFactory- a message factory- Returns:
- the logger associated with the given name and message factory
-
getLoggers
-
getLoggers
-
hasLogger
Deprecated.As of version2.25.0, planned to be removed! UsehasLogger(String, MessageFactory)instead.Checks if a logger associated with the given name exists.There can be made no assumptions on the message factory of the found logger. Callers are strongly advised to switch to
hasLogger(String, MessageFactory)and provide a message factory parameter!- Parameters:
name- a logger name- Returns:
true, if the logger exists;falseotherwise.
-
hasLogger
Checks if a logger associated with the given name and message factory exists.In the absence of a message factory, there can be made no assumptions on the message factory of the found logger. This lenient behaviour is only kept for backward compatibility. Callers are strongly advised to provide a message factory parameter to the method!
- Parameters:
name- a logger namemessageFactory- a message factory- Returns:
true, if the logger exists;falseotherwise.- Since:
- 2.5
-
hasLogger
Checks if a logger associated with the given name and message factory type exists.- Parameters:
name- a logger namemessageFactoryClass- a message factory class- Returns:
true, if the logger exists;falseotherwise.- Since:
- 2.5
-
putIfAbsent
Registers the provided logger.The logger will be registered using the keys provided by the
nameandmessageFactoryparameters and the values ofLogger.getName()andLogger.getMessageFactory().- Parameters:
name- a logger namemessageFactory- a message factorylogger- a logger instance
-
2.25.0, planned to be removed!