-
Notifications
You must be signed in to change notification settings - Fork 601
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
Logging factory #267
Logging factory #267
Conversation
I don't understand why the license check failed, I copied the Copyright from another source file in the project. |
Regarding the remaining nits from codacy, as you can see this is a pretty large bunch of changes. It's complaining about member variable declarations that are essentially unmoved from the pre-refactored code base, and I had no intention of re-factoring the classes to meet the new style guidelines. I hope that doesn't pose a significant issue. |
private final Buffer.PlainBuffer buffer; | ||
|
||
private byte[] EXPECTED_START_BYTES = new byte[] {'S', 'S', 'H', '-'}; | ||
|
||
public IdentificationStringParser(Buffer.PlainBuffer buffer) { | ||
public IdentificationStringParser(LoggerFactory loggerFactory, Buffer.PlainBuffer buffer) { | ||
this.log = loggerFactory.getLogger(IdentificationStringParser.class); |
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.
indentation is wrong
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.
I fixed the indentation (sorry I use tabs for 8 spaces reflexively). What’s up with the “license” issue?
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.
If you add new classes, easiest is to run gradle licenseFormat
. This will fix the license headers.
@@ -174,15 +174,15 @@ protected boolean isMyType(Key key) { | |||
}, | |||
|
|||
ED25519("ssh-ed25519") { | |||
private final Logger logger = LoggerFactory.getLogger(KeyType.class); | |||
private final Logger log = LoggerFactory.getLogger(KeyType.class); |
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.
Isn't this using the wrong LoggerFactory
now?
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.
There are a few places — like these static initializers — where it’s not possible to inject a LoggerFactory. I could use the new LoggerFactory.DEFAULT instead, but instead I just left them as-is, as the result is identical.
On Aug 24, 2016, at 6:39 AM, Jeroen van Erp notifications@github.com wrote:
In src/main/java/net/schmizz/sshj/common/KeyType.java #267 (comment):
@@ -174,15 +174,15 @@ protected boolean isMyType(Key key) {
},ED25519("ssh-ed25519") {
private final Logger logger = LoggerFactory.getLogger(KeyType.class);
Isn't this using the wrong LoggerFactory now?private final Logger log = LoggerFactory.getLogger(KeyType.class);
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/hierynomus/sshj/pull/267/files/f63a88ec9f1ca21db2d18eb68056fcf51a107ff5#r76040618, or mute the thread https://github.com/notifications/unsubscribe-auth/ABIPfWE18KqAoYxuTzYWKzAfdlJvq0IWks5qjC1WgaJpZM4JrhJ-.
Fixed license header in LoggerFactory.java (via gradle licenseForamat)
The PacketReaderTest fails with a NullPointerException because a mock STFPEngine's getLoggerFactory method returns null. It seems silly to do a null check for a final variable... it also seems silly to vastly complicate the packet reader test by creating a real SFTPEngine. I'll see if I can use Mockito to return a LoggerFactory.DEFAULT. |
Hi Jeroen, any thoughts on this PR? I have a few additional modifications that are waiting in the wings (not logging-related). |
I'll have a look after the weekend. I've quickly looked through it, but want a more in-depth look before I merge it. |
Hey Jeroen, any code review feedback yet? The feature is working well in my integration with our product, I'm eager to move forward. |
Here is a separate PR for the LoggingFactory injection we discussed in issue #264.