-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: Add support for custom COAP requests logging #99
Conversation
5dfb4d1
to
9a3407a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #99 +/- ##
============================================
- Coverage 93.18% 93.01% -0.17%
- Complexity 2028 2033 +5
============================================
Files 134 134
Lines 4577 4598 +21
Branches 618 617 -1
============================================
+ Hits 4265 4277 +12
- Misses 171 177 +6
- Partials 141 144 +3 ☔ View full report in Codecov by Sentry. |
9a3407a
to
90d7318
Compare
e9e33da
to
440831f
Compare
440831f
to
3b7e093
Compare
coap-core/src/main/java/com/mbed/coap/transport/LoggingCoapTransport.java
Show resolved
Hide resolved
@@ -80,9 +67,11 @@ public final class CoapServerBuilder { | |||
private int maxQueueSize = 100; | |||
private Filter.SimpleFilter<CoapRequest, CoapResponse> outboundFilter = Filter.identity(); | |||
private Filter.SimpleFilter<CoapRequest, CoapResponse> routeFilter = Filter.identity(); | |||
private Filter.SimpleFilter<CoapRequest, CoapResponse> requestFilter = Filter.identity(); |
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.
Could we name it somehow different, 'request' might be misleading depends on client or server. How about inboundFilter
or inboundPreFilter
as it happens quite early in a filter pipeline.
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 it enough to call it inboundRequestFilter
like it is now or e.g. serverRequestFilter
? There is CoapRequestConverter
in the beginning of the inboundService
filter chain which always makes CoapRequests out of the incoming packets meaning that only requests can come into this filter. Calling it just inboundPreFilter
makes a feeling that it accepts raw coap packets.
Introduce a decorator for CoapTransport which logs all inbound and outbound CoAP packets.
The change makes also possible to enable/disable transport logging on CoapServer creation.