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


##########
dubbo-common/src/main/java/org/apache/dubbo/common/logger/LoggerFactory.java:
##########
@@ -193,6 +193,32 @@ public static ErrorTypeAwareLogger 
getErrorTypeAwareLogger(String key) {
                 ERROR_TYPE_AWARE_LOGGERS, key, k -> new 
FailsafeErrorTypeAwareLogger(loggerAdapter.getLogger(k)));
     }
 
+    /**
+     * 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,
+                key.getName(),
+                name -> new 
FailsafeErrorTypeAwareLogger(loggerAdapter.getLogger(fqcn, name)));
+    }
+
+    /**
+     * Get error type aware logger by FQCN and a String key.
+     *
+     * @param fqcn the full qualified class name of caller
+     * @param key the returned logger will be named after key
+     * @return error type aware logger
+     */
+    public static ErrorTypeAwareLogger getErrorTypeAwareLogger(String fqcn, 
String key) {
+        return ConcurrentHashMapUtils.computeIfAbsent(

Review Comment:
   key -> Pair.of(key, fqcn)



-- 
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