-
Notifications
You must be signed in to change notification settings - Fork 264
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
2.x Redesign #437
2.x Redesign #437
Conversation
Docs need to be updated. |
ed3c534
to
f83ac8f
Compare
f83ac8f
to
9b14367
Compare
f5133b7
to
77a0c97
Compare
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 see a few TODO
s on "body replacement/without-body" - are they required for this PR? Or long-term?
Some of those restrictions could be mitigated with custom [`HttpLogWriter`](#writing) | ||
implementations, but they were never ideal. | ||
|
||
Starting with version 2.0 Logbook now comes with a [Strategy pattern](https://en.wikipedia.org/wiki/Strategy_pattern) |
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.
We may want to move the paragraphs above to the release notes of 2.0
or it's time to even provide a migration guide 😉
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.
This one in itself doesn't really require a migration, since it's just a new feature. But it's definitely worth having proper release notes for 2.0.
|
||
@Override | ||
public void write(final Precorrelation precorrelation, final HttpRequest request) { | ||
sinks.forEach(throwingConsumer(sink -> sink.write(precorrelation, request))); |
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.
Should these be sinks.filter(Sink::isActive).forEach
?
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.
Yes... 🤦♂️
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.
Fixed
import static org.apiguardian.api.API.Status.STABLE; | ||
|
||
@API(status = STABLE) | ||
public interface Strategy { |
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.
TODO documentation? Just saying as the README
teases this 😉
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 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.
Fixed
|
||
- [`BodyOnlyIfErrorStrategy`](logbook-core/src/test/java/org/zalando/logbook/BodyOnlyIfErrorStrategy.java) | ||
- [`ErrorResponseOnlyStrategy`](logbook-core/src/test/java/org/zalando/logbook/ErrorResponseOnlyStrategy.java) | ||
- [`WithoutBodyStrategy`](logbook-core/src/test/java/org/zalando/logbook/WithoutBodyStrategy.java) |
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.
What do you think of shipping such example strategies? We know that there is a demand for such behavior and we can easily foresee that users may want to apply this to multiple services.
BodyOnlyIfStatusAtLeastStrategy(int)
StatusAtLeastStrategy(int)
WithoutBodyStrategy
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.
Yeah, probably worth it. I was hoping that the interface is so easy to use that users can just implement it within 2-5 lines.
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.
Agreed on the easy-to-be-used, but still gets tedious to put these 5 lines in my 25 micro-services 😉
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 created #440 as a follow-up.
I don't have an opinion how we should behave there. |
30fa1be
to
4c2ca26
Compare
👍 |
Description
Motivation and Context
Fixes #211
Fixes #295
Fixes #296
Fixes #315
Fixes #334
Types of changes
Checklist: