feat(oohelperd): log messages at info level (#896)
We're using a request-specific logger where we also print the ID of the request. This design helps to observe logs produced by concurrent requests. Part of https://github.com/ooni/probe/issues/2183 While there, fix https://github.com/ooni/probe/issues/2241
This commit is contained in:
parent
8ca7645026
commit
4241ee4bc1
11 changed files with 225 additions and 27 deletions
|
|
@ -20,8 +20,9 @@ func TestHTTPDoWithInvalidURL(t *testing.T) {
|
|||
wg.Add(1)
|
||||
go httpDo(ctx, &httpConfig{
|
||||
Headers: nil,
|
||||
Logger: model.DiscardLogger,
|
||||
MaxAcceptableBody: 1 << 24,
|
||||
NewClient: func() model.HTTPClient {
|
||||
NewClient: func(model.Logger) model.HTTPClient {
|
||||
return http.DefaultClient
|
||||
},
|
||||
Out: httpch,
|
||||
|
|
@ -44,8 +45,9 @@ func TestHTTPDoWithHTTPTransportFailure(t *testing.T) {
|
|||
wg.Add(1)
|
||||
go httpDo(ctx, &httpConfig{
|
||||
Headers: nil,
|
||||
Logger: model.DiscardLogger,
|
||||
MaxAcceptableBody: 1 << 24,
|
||||
NewClient: func() model.HTTPClient {
|
||||
NewClient: func(model.Logger) model.HTTPClient {
|
||||
return &http.Client{
|
||||
Transport: &mocks.HTTPTransport{
|
||||
MockRoundTrip: func(req *http.Request) (*http.Response, error) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue