Implement MessageFactory-namespaced logger registry#2936
Conversation
|
@rgoers, would you mind reviewing this, please? (Checked with @ppkarwasz, he also agrees with deprecating |
AbstractLogger.checkMessageFactory()MessageFactory-namespaced logger registry
ppkarwasz
left a comment
There was a problem hiding this comment.
Nice work Volkan!
This might be great for 2.25.0, but I am not sure the problem requires such a drastical changes. By this I mean the deprecations in LoggerRegistry.
Note also that all message factories should implement equals and hashCode (I think this is technically a minor version change).
I will merge these changes to
AFAICT, |
Co-authored-by: Piotr P. Karwasz <piotr.github@karwasz.org>
This feature will be released with `2.24.1` before `2.25.0` this branch is pointing to. Hence, no need to duplicate entries.
Fixes #2933 by deprecating
AbstractLogger.checkMessageFactory()and removing its usages.Rationale
In its current state, all
LoggerContext#getLogger(String, MessageFactory)methods of allLoggerContextimplementations delegate toLoggerRegistry, which in essence is aMap<MessageFactory, Map<String, Logger>>. That is, allLoggerRegistry-producedLoggers areMessageFactory-namespaced. This renders thecheckMessageFactory()check redundant.Put another way,
getLogger("foo", someMF)will create aLoggerassociated withsomeMF.getLogger("foo")will create aLoggerassociated with theMFconfigured for theLC. In either case, ifsomeMF != the MF configured for the LC,Loggers will differ anyway, hencecheckMessageFactory()will always succeed.