oxsean commented on code in PR #15448:
URL: https://github.com/apache/dubbo/pull/15448#discussion_r2141778042


##########
dubbo-common/src/main/java/org/apache/dubbo/common/logger/LoggerFactory.java:
##########
@@ -190,7 +191,37 @@ public static ErrorTypeAwareLogger 
getErrorTypeAwareLogger(Class<?> key) {
      */
     public static ErrorTypeAwareLogger getErrorTypeAwareLogger(String key) {
         return ConcurrentHashMapUtils.computeIfAbsent(
-                ERROR_TYPE_AWARE_LOGGERS, key, k -> new 
FailsafeErrorTypeAwareLogger(loggerAdapter.getLogger(k)));
+                ERROR_TYPE_AWARE_LOGGERS,
+                Pair.of(FailsafeLogger.class.getName(), key),
+                pair -> new 
FailsafeErrorTypeAwareLogger(loggerAdapter.getLogger(pair)));
+    }
+
+    /**
+     * Get error type aware logger by FQCN and Class object.
+     *
+     * @param fqcn the full qualified class name of caller
+     * @param key the returned logger will be named after clazz
+     * @return error type aware logger
+     */
+    public static ErrorTypeAwareLogger getErrorTypeAwareLogger(String fqcn, 
Class<?> key) {
+        return ConcurrentHashMapUtils.computeIfAbsent(
+                ERROR_TYPE_AWARE_LOGGERS,
+                Pair.of(fqcn, key),

Review Comment:
   Pair.of(key, fqcn) 
   Put the highly distinctive ones at the beginning.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to