Class LoggerRegistry<T extends ExtendedLogger>
ExtendedLogger
registry by LoggerContext
implementations.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Deprecated.static interface
LoggerRegistry.MapFactory<T extends ExtendedLogger>
Deprecated.As of version2.25.0
, planned to be removed!static class
LoggerRegistry.WeakMapFactory<T extends ExtendedLogger>
Deprecated.As of version2.25.0
, planned to be removed! -
Constructor Summary
ConstructorDescriptionLoggerRegistry
(@Nullable LoggerRegistry.MapFactory<T> mapFactory) Deprecated.As of version2.25.0
, planned to be removed! -
Method Summary
Modifier and TypeMethodDescription@Nullable T
Deprecated.As of version2.25.0
, planned to be removed! UsegetLogger(String, MessageFactory)
instead.@Nullable T
getLogger
(String name, @Nullable MessageFactory messageFactory) Returns the logger associated with the given name and message factory.getLoggers
(Collection<T> destination) boolean
Deprecated.As of version2.25.0
, planned to be removed! UsehasLogger(String, MessageFactory)
instead.boolean
hasLogger
(String name, @Nullable MessageFactory messageFactory) Checks if a logger associated with the given name and message factory exists.boolean
hasLogger
(String name, Class<? extends MessageFactory> messageFactoryClass) Checks if a logger associated with the given name and message factory type exists.void
putIfAbsent
(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;false
otherwise.
-
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;false
otherwise.- 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;false
otherwise.- Since:
- 2.5
-
putIfAbsent
Registers the provided logger.The logger will be registered using the keys provided by the
name
andmessageFactory
parameters 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!