pact-foundation / pact-reference

Reference implementations for the pact specifications
https://pact.io
MIT License
91 stars 46 forks source link

Pact Verifier FFI Produces Excessive Logging #243

Closed adamrodger closed 1 year ago

adamrodger commented 1 year ago

On FFI v0.3.19 running a very simple example in PactNet (here: https://github.com/pact-foundation/pact-net/tree/master/samples/Messaging/Provider.Tests), the verifier produces a wall of text for logging at INFO level.

There are only 38 lines, but each line is 10-12KB long. For example, here is one line:

2023-01-05T17:37:00.057417Z  INFO ThreadId(17) verify_pact_internal{provider_info=ProviderInfo { name: "Event API", protocol: "http", host: "localhost", port: Some(9222), path: "/", transports: [ProviderTransport { transport: "http", port: Some(9222), path: Some("/"), scheme: None }] } filter=None pact=RequestResponsePact { consumer: Consumer { name: "Event API Consumer" }, provider: Provider { name: "Event API" }, interactions: [RequestResponseInteraction { id: None, description: "a request to check the api status", provider_states: [], request: Request { method: "GET", path: "/stats/status", query: None, headers: Some({"Accept": ["application/json"]}), body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } }, response: Response { status: 200, headers: Some({"Content-Type": ["application/json; charset=utf-8"]}), body: Present(b"{\"_links\":{\"self\":{\"href\":\"/stats/status\"},\"uptime\":{\"href\":\"/stats/uptime\"},\"version\":{\"href\":\"/stats/version\"}},\"alive\":true}", None, None), matching_rules: MatchingRules { rules: {BODY: MatchingRuleCategory { name: BODY, rules: {DocPath { path_tokens: [Root, Field("_links"), Field("uptime")], expr: "$._links.uptime" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links"), Field("self")], expr: "$._links.self" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links"), Field("self"), Field("href")], expr: "$._links.self.href" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links")], expr: "$._links" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("alive")], expr: "$.alive" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links"), Field("version"), Field("href")], expr: "$._links.version.href" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links"), Field("version")], expr: "$._links.version" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root], expr: "$" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links"), Field("uptime"), Field("href")], expr: "$._links.uptime.href" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }} }} }, generators: Generators { categories: {} } } }, RequestResponseInteraction { id: None, description: "a request to check the api uptime", provider_states: [], request: Request { method: "GET", path: "/stats/uptime", query: None, headers: Some({"Accept": ["application/json"]}), body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } }, response: Response { status: 200, headers: Some({"Content-Type": ["application/json; charset=utf-8"]}), body: Present(b"{\"upSince\":\"2014-06-27T23:51:12Z\"}", None, None), matching_rules: MatchingRules { rules: {BODY: MatchingRuleCategory { name: BODY, rules: {DocPath { path_tokens: [Root, Field("upSince")], expr: "$.upSince" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root], expr: "$" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }} }} }, generators: Generators { categories: {} } } }, RequestResponseInteraction { id: None, description: "a request to create a new event", provider_states: [], request: Request { method: "POST", path: "/events", query: None, headers: Some({"Authorization": ["Bearer SomeValidAuthToken"], "Content-Type": ["application/json; charset=utf-8"]}), body: Present(b"{\"eventId\":\"1f587704-2dcc-4313-a233-7b62b4b469db\",\"eventType\":\"DetailsView\",\"timestamp\":\"2011-07-01T01:41:03.0000000\"}", None, None), matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } }, response: Response { status: 201, headers: None, body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } } }, RequestResponseInteraction { id: None, description: "a request to retrieve all events", provider_states: [], request: Request { method: "GET", path: "/events", query: None, headers: Some({"Authorization": ["Bearer SomeValidAuthToken"], "Accept": ["application/json"]}), body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } }, response: Response { status: 200, headers: Some({"Content-Type": ["application/json; charset=utf-8"]}), body: Present(b"[{\"eventId\":\"3E83A96B-2A0C-49B1-9959-26DF23F83AEB\",\"eventType\":\"SearchView\",\"timestamp\":\"2014-06-30T01:38:00.8518952\"}]", None, None), matching_rules: MatchingRules { rules: {BODY: MatchingRuleCategory { name: BODY, rules: {DocPath { path_tokens: [Root, StarIndex, Field("eventId")], expr: "$[*].eventId" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, StarIndex, Field("eventType")], expr: "$[*].eventType" }: RuleList { rules: [Regex("SearchView|DetailsView")], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, StarIndex, Field("timestamp")], expr: "$[*].timestamp" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root], expr: "$" }: RuleList { rules: [MinType(1)], rule_logic: And, cascaded: false }} }} }, generators: Generators { categories: {} } } }, RequestResponseInteraction { id: None, description: "a request to retrieve all events with no authorization", provider_states: [ProviderState { name: "there are events with ids '45D80D13-D5A2-48D7-8353-CBB4C0EAABF5', '83F9262F-28F1-4703-AB1A-8CFD9E8249C9' and '3E83A96B-2A0C-49B1-9959-26DF23F83AEB'", params: {} }], request: Request { method: "GET", path: "/events", query: None, headers: Some({"Accept": ["application/json"]}), body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } }, response: Response { status: 401, headers: None, body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } } }, RequestResponseInteraction { id: None, description: "a request to retrieve event with id '83f9262f-28f1-4703-ab1a-8cfd9e8249c9'", provider_states: [ProviderState { name: "there is an event with id '83f9262f-28f1-4703-ab1a-8cfd9e8249c9'", params: {} }], request: Request { method: "GET", path: "/events/83f9262f-28f1-4703-ab1a-8cfd9e8249c9", query: None, headers: Some({"accept": ["application/json"], "authorization": ["Bearer SomeValidAuthToken"]}), body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } }, response: Response { status: 200, headers: Some({"content-type": ["application/json; charset=utf-8"]}), body: Present(b"{\"eventId\":\"83f9262f-28f1-4703-ab1a-8cfd9e8249c9\",\"eventType\":\"DetailsView\",\"timestamp\":\"2014-06-27T23:51:12.0000000Z\"}", None, None), matching_rules: MatchingRules { rules: {BODY: MatchingRuleCategory { name: BODY, rules: {DocPath { path_tokens: [Root, Field("eventType")], expr: "$.eventType" }: RuleList { rules: [Regex("SearchView|DetailsView")], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("timestamp")], expr: "$.timestamp" }: RuleList { rules: [Regex("^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])T(2[0-3]|[0-1][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]+)?(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$")], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("eventId")], expr: "$.eventId" }: RuleList { rules: [Regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")], rule_logic: And, cascaded: false }} }} }, generators: Generators { categories: {} } } }, RequestResponseInteraction { id: None, description: "a request to retrieve events with type 'DetailsView'", provider_states: [ProviderState { name: "there is one event with type 'DetailsView'", params: {} }], request: Request { method: "GET", path: "/events", query: Some({"type": ["DetailsView"]}), headers: Some({"Authorization": ["Bearer SomeValidAuthToken"], "Accept": ["application/json"]}), body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } }, response: Response { status: 200, headers: Some({"Content-Type": ["application/json; charset=utf-8"]}), body: Present(b"[{\"eventId\":\"45D80D13-D5A2-48D7-8353-CBB4C0EAABF5\",\"eventType\":\"DetailsView\",\"timestamp\":\"2014-06-30T01:37:41.0660548\"}]", None, None), matching_rules: MatchingRules { rules: {BODY: MatchingRuleCategory { name: BODY, rules: {DocPath { path_tokens: [Root, StarIndex, Field("eventId")], expr: "$[*].eventId" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root], expr: "$" }: RuleList { rules: [MinType(1)], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, StarIndex, Field("timestamp")], expr: "$[*].timestamp" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }} }} }, generators: Generators { categories: {} } } }], metadata: {"pactRust": {"ffi": "0.3.19", "models": "1.0.3"}, "pactSpecification": {"version": "2.0.0"}}, specification_version: V2 } options=VerificationOptions { request_filter: None, disable_ssl_verification: true, request_timeout: 2000, custom_headers: {}, coloured_output: true, no_pacts_is_error: true } provider_state_executor=HttpRequestProviderStateExecutor { state_change_url: Some("http://localhost:9222/provider-states"), state_change_teardown: false, state_change_body: true, reties: 3 } pending=false}:verify_interaction{provider=ProviderInfo { name: "Event API", protocol: "http", host: "localhost", port: Some(9222), path: "/", transports: [ProviderTransport { transport: "http", port: Some(9222), path: Some("/"), scheme: None }] } interaction=RequestResponseInteraction { id: None, description: "a request to check the api status", provider_states: [], request: Request { method: "GET", path: "/stats/status", query: None, headers: Some({"Accept": ["application/json"]}), body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } }, response: Response { status: 200, headers: Some({"Content-Type": ["application/json; charset=utf-8"]}), body: Present(b"{\"_links\":{\"self\":{\"href\":\"/stats/status\"},\"uptime\":{\"href\":\"/stats/uptime\"},\"version\":{\"href\":\"/stats/version\"}},\"alive\":true}", None, None), matching_rules: MatchingRules { rules: {BODY: MatchingRuleCategory { name: BODY, rules: {DocPath { path_tokens: [Root, Field("_links"), Field("uptime")], expr: "$._links.uptime" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links"), Field("self")], expr: "$._links.self" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links"), Field("self"), Field("href")], expr: "$._links.self.href" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links")], expr: "$._links" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("alive")], expr: "$.alive" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links"), Field("version"), Field("href")], expr: "$._links.version.href" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links"), Field("version")], expr: "$._links.version" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root], expr: "$" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links"), Field("uptime"), Field("href")], expr: "$._links.uptime.href" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }} }} }, generators: Generators { categories: {} } } } pact=RequestResponsePact { consumer: Consumer { name: "Event API Consumer" }, provider: Provider { name: "Event API" }, interactions: [RequestResponseInteraction { id: None, description: "a request to check the api status", provider_states: [], request: Request { method: "GET", path: "/stats/status", query: None, headers: Some({"Accept": ["application/json"]}), body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } }, response: Response { status: 200, headers: Some({"Content-Type": ["application/json; charset=utf-8"]}), body: Present(b"{\"_links\":{\"self\":{\"href\":\"/stats/status\"},\"uptime\":{\"href\":\"/stats/uptime\"},\"version\":{\"href\":\"/stats/version\"}},\"alive\":true}", None, None), matching_rules: MatchingRules { rules: {BODY: MatchingRuleCategory { name: BODY, rules: {DocPath { path_tokens: [Root, Field("_links"), Field("uptime")], expr: "$._links.uptime" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links"), Field("self")], expr: "$._links.self" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links"), Field("self"), Field("href")], expr: "$._links.self.href" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links")], expr: "$._links" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("alive")], expr: "$.alive" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links"), Field("version"), Field("href")], expr: "$._links.version.href" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links"), Field("version")], expr: "$._links.version" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root], expr: "$" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("_links"), Field("uptime"), Field("href")], expr: "$._links.uptime.href" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }} }} }, generators: Generators { categories: {} } } }, RequestResponseInteraction { id: None, description: "a request to check the api uptime", provider_states: [], request: Request { method: "GET", path: "/stats/uptime", query: None, headers: Some({"Accept": ["application/json"]}), body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } }, response: Response { status: 200, headers: Some({"Content-Type": ["application/json; charset=utf-8"]}), body: Present(b"{\"upSince\":\"2014-06-27T23:51:12Z\"}", None, None), matching_rules: MatchingRules { rules: {BODY: MatchingRuleCategory { name: BODY, rules: {DocPath { path_tokens: [Root, Field("upSince")], expr: "$.upSince" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root], expr: "$" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }} }} }, generators: Generators { categories: {} } } }, RequestResponseInteraction { id: None, description: "a request to create a new event", provider_states: [], request: Request { method: "POST", path: "/events", query: None, headers: Some({"Authorization": ["Bearer SomeValidAuthToken"], "Content-Type": ["application/json; charset=utf-8"]}), body: Present(b"{\"eventId\":\"1f587704-2dcc-4313-a233-7b62b4b469db\",\"eventType\":\"DetailsView\",\"timestamp\":\"2011-07-01T01:41:03.0000000\"}", None, None), matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } }, response: Response { status: 201, headers: None, body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } } }, RequestResponseInteraction { id: None, description: "a request to retrieve all events", provider_states: [], request: Request { method: "GET", path: "/events", query: None, headers: Some({"Authorization": ["Bearer SomeValidAuthToken"], "Accept": ["application/json"]}), body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } }, response: Response { status: 200, headers: Some({"Content-Type": ["application/json; charset=utf-8"]}), body: Present(b"[{\"eventId\":\"3E83A96B-2A0C-49B1-9959-26DF23F83AEB\",\"eventType\":\"SearchView\",\"timestamp\":\"2014-06-30T01:38:00.8518952\"}]", None, None), matching_rules: MatchingRules { rules: {BODY: MatchingRuleCategory { name: BODY, rules: {DocPath { path_tokens: [Root, StarIndex, Field("eventId")], expr: "$[*].eventId" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, StarIndex, Field("eventType")], expr: "$[*].eventType" }: RuleList { rules: [Regex("SearchView|DetailsView")], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, StarIndex, Field("timestamp")], expr: "$[*].timestamp" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root], expr: "$" }: RuleList { rules: [MinType(1)], rule_logic: And, cascaded: false }} }} }, generators: Generators { categories: {} } } }, RequestResponseInteraction { id: None, description: "a request to retrieve all events with no authorization", provider_states: [ProviderState { name: "there are events with ids '45D80D13-D5A2-48D7-8353-CBB4C0EAABF5', '83F9262F-28F1-4703-AB1A-8CFD9E8249C9' and '3E83A96B-2A0C-49B1-9959-26DF23F83AEB'", params: {} }], request: Request { method: "GET", path: "/events", query: None, headers: Some({"Accept": ["application/json"]}), body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } }, response: Response { status: 401, headers: None, body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } } }, RequestResponseInteraction { id: None, description: "a request to retrieve event with id '83f9262f-28f1-4703-ab1a-8cfd9e8249c9'", provider_states: [ProviderState { name: "there is an event with id '83f9262f-28f1-4703-ab1a-8cfd9e8249c9'", params: {} }], request: Request { method: "GET", path: "/events/83f9262f-28f1-4703-ab1a-8cfd9e8249c9", query: None, headers: Some({"accept": ["application/json"], "authorization": ["Bearer SomeValidAuthToken"]}), body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } }, response: Response { status: 200, headers: Some({"content-type": ["application/json; charset=utf-8"]}), body: Present(b"{\"eventId\":\"83f9262f-28f1-4703-ab1a-8cfd9e8249c9\",\"eventType\":\"DetailsView\",\"timestamp\":\"2014-06-27T23:51:12.0000000Z\"}", None, None), matching_rules: MatchingRules { rules: {BODY: MatchingRuleCategory { name: BODY, rules: {DocPath { path_tokens: [Root, Field("eventType")], expr: "$.eventType" }: RuleList { rules: [Regex("SearchView|DetailsView")], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("timestamp")], expr: "$.timestamp" }: RuleList { rules: [Regex("^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[0-1]|0[1-9]|[1-2][0-9])T(2[0-3]|[0-1][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]+)?(Z|[+-](?:2[0-3]|[0-1][0-9]):[0-5][0-9])?$")], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, Field("eventId")], expr: "$.eventId" }: RuleList { rules: [Regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")], rule_logic: And, cascaded: false }} }} }, generators: Generators { categories: {} } } }, RequestResponseInteraction { id: None, description: "a request to retrieve events with type 'DetailsView'", provider_states: [ProviderState { name: "there is one event with type 'DetailsView'", params: {} }], request: Request { method: "GET", path: "/events", query: Some({"type": ["DetailsView"]}), headers: Some({"Authorization": ["Bearer SomeValidAuthToken"], "Accept": ["application/json"]}), body: Missing, matching_rules: MatchingRules { rules: {} }, generators: Generators { categories: {} } }, response: Response { status: 200, headers: Some({"Content-Type": ["application/json; charset=utf-8"]}), body: Present(b"[{\"eventId\":\"45D80D13-D5A2-48D7-8353-CBB4C0EAABF5\",\"eventType\":\"DetailsView\",\"timestamp\":\"2014-06-30T01:37:41.0660548\"}]", None, None), matching_rules: MatchingRules { rules: {BODY: MatchingRuleCategory { name: BODY, rules: {DocPath { path_tokens: [Root, StarIndex, Field("eventId")], expr: "$[*].eventId" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root], expr: "$" }: RuleList { rules: [MinType(1)], rule_logic: And, cascaded: false }, DocPath { path_tokens: [Root, StarIndex, Field("timestamp")], expr: "$[*].timestamp" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }} }} }, generators: Generators { categories: {} } } }], metadata: {"pactRust": {"ffi": "0.3.19", "models": "1.0.3"}, "pactSpecification": {"version": "2.0.0"}}, specification_version: V2 } options=VerificationOptions { request_filter: None, disable_ssl_verification: true, request_timeout: 2000, custom_headers: {}, coloured_output: true, no_pacts_is_error: true } provider_state_executor=HttpRequestProviderStateExecutor { state_change_url: Some("http://localhost:9222/provider-states"), state_change_teardown: false, state_change_body: true, reties: 3 }}: pact_verifier::provider_client: Sending request to provider at http://localhost:9222/

In VS Code it simply refuses to show most of the logs because the lines are so long:

image

The info contained in each line is very verbose and is not formatted in a human-readable way. It would be much better if most of that detail was output at DEBUG or TRACE level and the INFO level messages just contained a few important details.

This is the full output from the same example running under FFI 0.3.11 for example:

Verifier Logs
-------------
2023-01-05T17:44:06.123002Z  INFO ThreadId(17) pact_verifier: Running provider verification for 'a request to check the api status'
2023-01-05T17:44:06.123199Z  INFO ThreadId(17) pact_verifier::provider_client: Sending request to provider at http://localhost:9222/
2023-01-05T17:44:06.123208Z  INFO ThreadId(17) pact_verifier::provider_client: Sending request HTTP Request ( method: GET, path: /stats/status, query: None, headers: Some({"Accept": ["application/json"]}), body: Missing )
2023-01-05T17:44:06.209261Z  INFO ThreadId(17) pact_verifier::provider_client: Received response: HTTP Response ( status: 200, headers: Some({"date": ["Thu", "05 Jan 2023 17:44:06 GMT"], "transfer-encoding": ["chunked"], "server": ["Kestrel"], "content-type": ["application/json; charset=utf-8"]}), body: Present(127 bytes, application/json;charset=utf-8) )
2023-01-05T17:44:06.209333Z  INFO ThreadId(17) pact_matching: comparing to expected response: HTTP Response ( status: 200, headers: Some({"Content-Type": ["application/json; charset=utf-8"]}), body: Present(127 bytes) )
2023-01-05T17:44:06.213190Z  INFO ThreadId(17) pact_verifier: Running provider verification for 'a request to check the api uptime'
2023-01-05T17:44:06.213320Z  INFO ThreadId(17) pact_verifier::provider_client: Sending request to provider at http://localhost:9222/
2023-01-05T17:44:06.213325Z  INFO ThreadId(17) pact_verifier::provider_client: Sending request HTTP Request ( method: GET, path: /stats/uptime, query: None, headers: Some({"Accept": ["application/json"]}), body: Missing )
2023-01-05T17:44:06.218584Z  INFO ThreadId(17) pact_verifier::provider_client: Received response: HTTP Response ( status: 200, headers: Some({"date": ["Thu", "05 Jan 2023 17:44:06 GMT"], "transfer-encoding": ["chunked"], "server": ["Kestrel"], "content-type": ["application/json; charset=utf-8"]}), body: Present(77 bytes, application/json;charset=utf-8) )
2023-01-05T17:44:06.218613Z  INFO ThreadId(17) pact_matching: comparing to expected response: HTTP Response ( status: 200, headers: Some({"Content-Type": ["application/json; charset=utf-8"]}), body: Present(34 bytes) )
2023-01-05T17:44:06.221694Z  INFO ThreadId(17) pact_verifier: Running provider verification for 'a request to create a new event'
2023-01-05T17:44:06.221730Z  INFO ThreadId(17) pact_verifier::provider_client: Sending request to provider at http://localhost:9222/
2023-01-05T17:44:06.221731Z  INFO ThreadId(17) pact_verifier::provider_client: Sending request HTTP Request ( method: POST, path: /events, query: None, headers: Some({"Content-Type": ["application/json; charset=utf-8"], "Authorization": ["Bearer SomeValidAuthToken"]}), body: Present(118 bytes) )
2023-01-05T17:44:06.336834Z  INFO ThreadId(17) pact_verifier::provider_client: Received response: HTTP Response ( status: 201, headers: Some({"content-length": ["0"], "date": ["Thu", "05 Jan 2023 17:44:06 GMT"], "server": ["Kestrel"]}), body: Empty )
2023-01-05T17:44:06.336854Z  INFO ThreadId(17) pact_matching: comparing to expected response: HTTP Response ( status: 201, headers: None, body: Missing )
2023-01-05T17:44:06.339494Z  INFO ThreadId(17) pact_verifier: Running provider verification for 'a request to retrieve all events'
2023-01-05T17:44:06.339532Z  INFO ThreadId(17) pact_verifier::provider_client: Sending request to provider at http://localhost:9222/
2023-01-05T17:44:06.339534Z  INFO ThreadId(17) pact_verifier::provider_client: Sending request HTTP Request ( method: GET, path: /events, query: None, headers: Some({"Accept": ["application/json"], "Authorization": ["Bearer SomeValidAuthToken"]}), body: Missing )
2023-01-05T17:44:06.351961Z  INFO ThreadId(17) pact_verifier::provider_client: Received response: HTTP Response ( status: 200, headers: Some({"transfer-encoding": ["chunked"], "server": ["Kestrel"], "content-type": ["application/json; charset=utf-8"], "date": ["Thu", "05 Jan 2023 17:44:06 GMT"]}), body: Present(356 bytes, application/json;charset=utf-8) )
2023-01-05T17:44:06.351988Z  INFO ThreadId(17) pact_matching: comparing to expected response: HTTP Response ( status: 200, headers: Some({"Content-Type": ["application/json; charset=utf-8"]}), body: Present(119 bytes) )
2023-01-05T17:44:06.355414Z  INFO ThreadId(17) pact_verifier: Running setup provider state change handler 'there are events with ids '45D80D13-D5A2-48D7-8353-CBB4C0EAABF5', '83F9262F-28F1-4703-AB1A-8CFD9E8249C9' and '3E83A96B-2A0C-49B1-9959-26DF23F83AEB'' for 'a request to retrieve all events with no authorization'
2023-01-05T17:44:06.362411Z  INFO ThreadId(17) pact_verifier: Running provider verification for 'a request to retrieve all events with no authorization'
2023-01-05T17:44:06.362456Z  INFO ThreadId(17) pact_verifier::provider_client: Sending request to provider at http://localhost:9222/
2023-01-05T17:44:06.362458Z  INFO ThreadId(17) pact_verifier::provider_client: Sending request HTTP Request ( method: GET, path: /events, query: None, headers: Some({"Accept": ["application/json"]}), body: Missing )
2023-01-05T17:44:06.366034Z  INFO ThreadId(17) pact_verifier::provider_client: Received response: HTTP Response ( status: 401, headers: Some({"date": ["Thu", "05 Jan 2023 17:44:06 GMT"], "content-length": ["0"], "server": ["Kestrel"], "www-authenticate": ["Bearer"]}), body: Empty )
2023-01-05T17:44:06.366051Z  INFO ThreadId(17) pact_matching: comparing to expected response: HTTP Response ( status: 401, headers: None, body: Missing )
2023-01-05T17:44:06.368685Z  INFO ThreadId(17) pact_verifier: Running setup provider state change handler 'there is an event with id '83f9262f-28f1-4703-ab1a-8cfd9e8249c9'' for 'a request to retrieve event with id '83f9262f-28f1-4703-ab1a-8cfd9e8249c9''
2023-01-05T17:44:06.372134Z  INFO ThreadId(17) pact_verifier: Running provider verification for 'a request to retrieve event with id '83f9262f-28f1-4703-ab1a-8cfd9e8249c9''
2023-01-05T17:44:06.372189Z  INFO ThreadId(17) pact_verifier::provider_client: Sending request to provider at http://localhost:9222/
2023-01-05T17:44:06.372191Z  INFO ThreadId(17) pact_verifier::provider_client: Sending request HTTP Request ( method: GET, path: /events/83f9262f-28f1-4703-ab1a-8cfd9e8249c9, query: None, headers: Some({"accept": ["application/json"], "authorization": ["Bearer SomeValidAuthToken"]}), body: Missing )
2023-01-05T17:44:06.374012Z  INFO ThreadId(17) pact_verifier::provider_client: Received response: HTTP Response ( status: 200, headers: Some({"server": ["Kestrel"], "date": ["Thu", "05 Jan 2023 17:44:06 GMT"], "transfer-encoding": ["chunked"], "content-type": ["application/json; charset=utf-8"]}), body: Present(118 bytes, application/json;charset=utf-8) )
2023-01-05T17:44:06.374032Z  INFO ThreadId(17) pact_matching: comparing to expected response: HTTP Response ( status: 200, headers: Some({"content-type": ["application/json; charset=utf-8"]}), body: Present(119 bytes) )
2023-01-05T17:44:06.376912Z  INFO ThreadId(17) pact_verifier: Running setup provider state change handler 'there is one event with type 'DetailsView'' for 'a request to retrieve events with type 'DetailsView''
2023-01-05T17:44:06.380191Z  INFO ThreadId(17) pact_verifier: Running provider verification for 'a request to retrieve events with type 'DetailsView''
2023-01-05T17:44:06.380254Z  INFO ThreadId(17) pact_verifier::provider_client: Sending request to provider at http://localhost:9222/
2023-01-05T17:44:06.380256Z  INFO ThreadId(17) pact_verifier::provider_client: Sending request HTTP Request ( method: GET, path: /events, query: Some({"type": ["DetailsView"]}), headers: Some({"Authorization": ["Bearer SomeValidAuthToken"], "Accept": ["application/json"]}), body: Missing )
2023-01-05T17:44:06.384950Z  INFO ThreadId(17) pact_verifier::provider_client: Received response: HTTP Response ( status: 200, headers: Some({"content-type": ["application/json; charset=utf-8"], "date": ["Thu", "05 Jan 2023 17:44:06 GMT"], "transfer-encoding": ["chunked"], "server": ["Kestrel"]}), body: Present(120 bytes, application/json;charset=utf-8) )
2023-01-05T17:44:06.384974Z  INFO ThreadId(17) pact_matching: comparing to expected response: HTTP Response ( status: 200, headers: Some({"Content-Type": ["application/json; charset=utf-8"]}), body: Present(120 bytes) )
2023-01-05T17:44:06.385559Z  WARN ThreadId(17) pact_matching::metrics: 

Please note:
We are tracking events anonymously to gather important usage statistics like Pact version and operating system. To disable tracking, set the 'PACT_DO_NOT_TRACK' environment variable to 'true'.

That's much more readable and helps users track down any matching issues.

rholshausen commented 1 year ago

I've modified the logging to not log spans at INFO and above, only include minimal spans at DEBUG and all the spans at TRACE.