-
Notifications
You must be signed in to change notification settings - Fork 170
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
Support for custom logger in servers #371
Conversation
4bdf859
to
3ef5b55
Compare
Please sign the commit. Example:
|
3ef5b55
to
e69882e
Compare
Some of the newly added tests are failing on travis. |
But they're not failing on my Linux box, apart from an Errorf issue with my version of go apparently. I'm still running
Do you have any clue why that might happen on trevis? |
You have introduced a race condition in the tests with the package-global variable You can probably reproduce locally by running |
e69882e
to
f170cb8
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.
Interestingly the tests are still racy. I think Serve() spawns a goroutine for each message ?
You'll need to make the logger in the tests properly goroutine-safe with a lock or atomics (eg. atomic.StoreUint32
)
f170cb8
to
8ac1283
Compare
b965a5b
to
9466bb5
Compare
Codecov Report
@@ Coverage Diff @@
## master #371 +/- ##
==========================================
+ Coverage 70.46% 70.86% +0.39%
==========================================
Files 82 84 +2
Lines 4212 4256 +44
==========================================
+ Hits 2968 3016 +48
+ Misses 1078 1076 -2
+ Partials 166 164 -2
Continue to review full report at Codecov.
|
cfef167
to
d8f4331
Compare
I think I finally managed to get everything working as expected. |
Thanks! I'll take a look soon. |
d8f4331
to
190332c
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.
lgtm
This is good to be merged once Chris's comment is addressed. |
190332c
to
0444670
Compare
server6 object Signed-off-by: Valerio Santinelli <santinelli@altralogica.it>
This looks like an overly complicated version of #373 and in particular exposes the dhcpv4 internals to the logger... Most people working on a logger might not want to expose that. I'd reconsider, but just my opinion. Thanks either way! |
c5bd530
to
09b9ef1
Compare
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
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.
lgtm
Your version is simpler but this one is consistent with what is already done with the nclient and allows to tune how to log the exchanged packets. I am open to reconsider the interface though. |
This adds support for a custom logger for both the server4 and server6 packages.
Fixes #370.