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

Gather all endpoints and sort before logging them #1002

Merged
merged 1 commit into from Apr 21, 2015

Conversation

Projects
None yet
4 participants
@softarn
Contributor

softarn commented Apr 20, 2015

The list of endpoints logged when starting Dropwizard becomes hard to read when it grows larger. This will sort all endpoints before logging them.

}
}
private static class EndpointComparator implements Comparator<EndpointLogLine>, Serializable {

This comment has been minimized.

@arteam

arteam Apr 20, 2015

Member

Could we just make EndpointLogLine to implement Comparable<EndpointLogLine>?
If it so, we won't need to specify a comparator explicitly.

@arteam

arteam Apr 20, 2015

Member

Could we just make EndpointLogLine to implement Comparable<EndpointLogLine>?
If it so, we won't need to specify a comparator explicitly.

This comment has been minimized.

@softarn

softarn Apr 20, 2015

Contributor

So much boiler code for equals, hashcode. That's why I chose the
comparator, want me to switch anyway?
On Apr 20, 2015 9:31 PM, "Artem Prigoda" notifications@github.com wrote:

In
dropwizard-jersey/src/main/java/io/dropwizard/jersey/DropwizardResourceConfig.java
#1002 (comment):

  •    public String getHttpMethod() {
    
  •        return httpMethod;
    
  •    }
    
  •    public String getBasePath() {
    
  •        return basePath;
    
  •    }
    
  •    @Override
    
  •    public String toString() {
    
  •        return String.format("    %-7s %s (%s)", httpMethod, basePath, klass.getCanonicalName());
    
  •    }
    
  • }
  • private static class EndpointComparator implements Comparator, Serializable {

Could we just make EndpointLogLine to implement
Comparable?
If it so, we won't need to specify a comparator explicitly.


Reply to this email directly or view it on GitHub
https://github.com/dropwizard/dropwizard/pull/1002/files#r28720803.

@softarn

softarn Apr 20, 2015

Contributor

So much boiler code for equals, hashcode. That's why I chose the
comparator, want me to switch anyway?
On Apr 20, 2015 9:31 PM, "Artem Prigoda" notifications@github.com wrote:

In
dropwizard-jersey/src/main/java/io/dropwizard/jersey/DropwizardResourceConfig.java
#1002 (comment):

  •    public String getHttpMethod() {
    
  •        return httpMethod;
    
  •    }
    
  •    public String getBasePath() {
    
  •        return basePath;
    
  •    }
    
  •    @Override
    
  •    public String toString() {
    
  •        return String.format("    %-7s %s (%s)", httpMethod, basePath, klass.getCanonicalName());
    
  •    }
    
  • }
  • private static class EndpointComparator implements Comparator, Serializable {

Could we just make EndpointLogLine to implement
Comparable?
If it so, we won't need to specify a comparator explicitly.


Reply to this email directly or view it on GitHub
https://github.com/dropwizard/dropwizard/pull/1002/files#r28720803.

This comment has been minimized.

@arteam

arteam Apr 20, 2015

Member

That's a reasonable argument. Let's leave it then.

@arteam

arteam Apr 20, 2015

Member

That's a reasonable argument. Let's leave it then.

@arteam

This comment has been minimized.

Show comment
Hide comment
@arteam

arteam Apr 20, 2015

Member

@softarn, thanks for the contribution!
I've added some notes about where the PR could be improved, but in overall it looks great.

Member

arteam commented Apr 20, 2015

@softarn, thanks for the contribution!
I've added some notes about where the PR could be improved, but in overall it looks great.

@softarn

This comment has been minimized.

Show comment
Hide comment
@softarn

softarn Apr 21, 2015

Contributor

@arteam I've updated the commit. Thank you for the comments!

Contributor

softarn commented Apr 21, 2015

@arteam I've updated the commit. Thank you for the comments!

arteam added a commit that referenced this pull request Apr 21, 2015

Merge pull request #1002 from softarn/sorted-endpoints-logging
Gather all endpoints and sort before logging them

@arteam arteam merged commit b073dab into dropwizard:master Apr 21, 2015

@arteam

This comment has been minimized.

Show comment
Hide comment
@arteam

arteam Apr 21, 2015

Member

Thanks, @softarn, for your efforts on that.

Member

arteam commented Apr 21, 2015

Thanks, @softarn, for your efforts on that.

@jplock jplock added this to the 0.9.0 milestone Apr 27, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment