-
Notifications
You must be signed in to change notification settings - Fork 26.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Adds feature of displaying FAQ link in logger output. #10292
Conversation
dubbo-common/src/main/java/org/apache/dubbo/common/logger/ErrorType.java
Outdated
Show resolved
Hide resolved
dubbo-common/src/main/java/org/apache/dubbo/common/logger/ErrorType.java
Outdated
Show resolved
Hide resolved
...ommon/src/main/java/org/apache/dubbo/common/logger/support/FailsafeErrorTypeAwareLogger.java
Show resolved
Hide resolved
...-registry-zookeeper/src/main/java/org/apache/dubbo/registry/zookeeper/ZookeeperRegistry.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## 3.1 #10292 +/- ##
============================================
- Coverage 65.73% 65.56% -0.18%
+ Complexity 319 297 -22
============================================
Files 1233 1236 +3
Lines 53730 53904 +174
Branches 8111 8123 +12
============================================
+ Hits 35322 35344 +22
- Misses 14577 14709 +132
- Partials 3831 3851 +20
Continue to review full report at Codecov.
|
…r in logger factory. In order to obtain 'disabled' field in FailsafeLogger, a method called 'getDisabled()' in FailsafeLogger is also added.
…rs into logger methods.
27e61c9
to
4731fc1
Compare
What is the purpose of the change
中文:
为 #10223 提供一种思路。
其提供一个继承于 Logger 接口的 ErrorTypeAwareLogger 接口。这个接口在记录日志时支持传入 ErrorType 对象,以确认异常的种类(可能原因)和对应的 FAQ 地址,从而能够实现在日志输出时同时附带输出对应的官网 FAQ 说明链接的功能。同时其与 Logger 接口独立,确保了向后兼容性。
English Version:
This proposal provides a solution of #10223.
It provides a interface called ErrorTypeAwareLogger, which extends Logger interface. This interface supports receiving an ErrorType instance that contains error cause and corresponding FAQ URL address. With that, the logger will also outputs a URL to instructions. It's backward-compatible since it's a seperate interface.
Brief changelog
中文:
新增了一个 ErrorType,用于代表一种(类)异常,内有异常的可能原因和异常排除文档的 URL 地址。English Version:
Created a new enum called ErrorType that represents a kind of error. It contains error cause and the corresponding address of solution document.Verifying this change
调用测试方法 / Invoke testing method below:
org.apache.dubbo.common.logger.support.FailsafeErrorTypeAwareLoggerTest#testInstructionShownOrNot
代码如下 / Code is here:
运行可以看到输出了如下消息 / After runs, the console window prints out these message:
Checklist