-
Notifications
You must be signed in to change notification settings - Fork 1
init logger tripperware/middleware #1
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
Conversation
4148297 to
b0b6d03
Compare
b0b6d03 to
a04fc42
Compare
c320060 to
86b698a
Compare
86b698a to
9eae156
Compare
| } | ||
| } | ||
|
|
||
| func FeedContext(loggerContext *logger.Context, ctx context.Context, req *http.Request, startTime time.Time) *logger.Context { |
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.
add some doc 👍
middleware/inject_logger.go
Outdated
| ) | ||
|
|
||
| // InjectLogger will inject logger on request context if not exist | ||
| // this injection was made for every incoming request so prefer to |
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.
is made
pimousse1099
left a comment
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.
Do you have some tests with a global context and multiple requests in order to check that global logger is not affected by other loggers (i.e request scoped loggers) ?
tripperware/logger_test.go
Outdated
| "github.com/gol4ng/logger-http/tripperware" | ||
| "github.com/gol4ng/logger/formatter" | ||
| "github.com/gol4ng/logger/handler" | ||
| "github.com/stretchr/testify/assert" |
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.
a little sort 👍
88a0d03 to
7a8924d
Compare
7a8924d to
5014fe5
Compare
will log something similar to
OK
Transport error
Transport panic