Skip to content
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

Make middlewares optional #80

Merged
merged 1 commit into from
Jul 24, 2020

Conversation

matheusd
Copy link
Contributor

This makes the middlewares offered by the server package optional. This
allows full customization by implementations.

Fixes #59

@patrick-ogrady
Copy link
Contributor

@matheusd Just an FYI that it won't let me review this until you sign your commit.

This makes the middlewares offered by the server package optional. This
allows full customization by implementations.
@matheusd matheusd force-pushed the optional-middlewares branch from 3bf98fd to be5c5f4 Compare July 23, 2020 18:18
@patrick-ogrady
Copy link
Contributor

Example logs look great:

2020/07/24 13:58:36 Listening on port 8080
2020/07/24 13:58:51 POST /network/list 189.853µs
2020/07/24 13:58:51 POST /network/status 250.172µs
2020/07/24 13:58:51 POST /network/options 110.503µs
2020/07/24 13:58:51 POST /block 294.214µs
2020/07/24 13:58:51 POST /block/transaction 84.845µs
2020/07/24 13:58:51 POST /block 100.8µs
2020/07/24 13:58:51 POST /block 97.317µs
2020/07/24 13:58:51 POST /block 133.419µs
2020/07/24 13:58:51 POST /block 251.101µs
2020/07/24 13:58:51 POST /block 149.209µs
2020/07/24 13:58:51 POST /block 129.884µs
2020/07/24 13:58:51 POST /block 446.035µs
2020/07/24 13:58:51 POST /block 451.176µs
2020/07/24 13:58:51 POST /block 314.461µs
2020/07/24 13:58:51 POST /block 222.318µs
2020/07/24 13:58:51 POST /block 220.745µs

@patrick-ogrady
Copy link
Contributor

Awesome work @matheusd 🎉

@patrick-ogrady patrick-ogrady merged commit 103e2a1 into coinbase:master Jul 24, 2020
@matheusd matheusd deleted the optional-middlewares branch July 27, 2020 10:59
@matheusd
Copy link
Contributor Author

Should've mentioned in the original msg, but here's something that can produce customizable logging with slightly more info (status code, total bytes sent): https://github.com/matheusd/middlelogger/

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

Successfully merging this pull request may close these issues.

Make the Logger an optional middleware in routers
2 participants