-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Unexpected JavaLogger behavior fixed #1047
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
Conversation
|
I think you may gone a little too far in this change. I agree with deprecating the default constructor, but by attempting to provide an internal workaround, you are adding complexity that we don't need. I think that by simply marking the default constructor as deprecated and add the new constructor will suffice. We will remove the default constructor in Feign 11. |
kdavisk6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comments
|
@kdavisk6 I absolutely agree with you about workaround. But I decided that it's better to make proposal and this is the best I can provide to keep default constructor and change its logic. I'll fix it now |
|
I understand and appreciate the effort. We can add additional documentation to let user's know of the limitation and our suggested workaround. |
|
@kdavisk6 I'm going to change javadoc for deprecated method to warn users |
|
Makes sense
…On Mon, Aug 26, 2019, 21:33 Max Syachin ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In core/src/main/java/feign/Logger.java
<#1047 (comment)>:
> + *
+ * That's why this constructor will be removed in future.
+ */
+ @deprecated
+ public JavaLogger() {
+ logger = java.util.logging.Logger.getLogger(Logger.class.getName());
+ }
+
+ /**
+ * Constructor for JavaLogger class
+ *
+ * @param loggerName - A name for the logger. This should be a dot-separated name and should
+ * normally be based on the package name or class name of the subsystem, such as java.net
+ * or javax.swing
+ */
+ public JavaLogger(String loggerName) {
maybe both? I think just a class could be not enough. For example if I
have 2 same clients such
SomeService client2 = ...;
And in some reason I want to write them to different files. It will force
developers to make special class.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1047?email_source=notifications&email_token=AABBLDSQ2QRXEPG7P5OC373QGOPPFA5CNFSM4IPFK4I2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCCULZCI#discussion_r317527168>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABBLDS4A7PTQH44SL7AJ5DQGOPPFANCNFSM4IPFK4IQ>
.
|
|
Done =) |
Fixes #985 * JavaLogger(String name) added. Workaround for JavaLogger() provided * JavaLogger() marked as deprecated. Workaround for JavaLogger() removed * Little fix for note in README * One more little fix for note in README * JavaLogger(Class<?>) constructor added
Fixes #985 * JavaLogger(String name) added. Workaround for JavaLogger() provided * JavaLogger() marked as deprecated. Workaround for JavaLogger() removed * Little fix for note in README * One more little fix for note in README * JavaLogger(Class<?>) constructor added
Investigating #985 task I've created solution. I'm not sure this solution is good, but I tried to explain my thoughts and solution inside code. Also, I copy explanation here.
Also I'm not sure it's a good idea to create log files during test run. But I don't really know how to remove them after tests...