pact-foundation / pact-reference

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

FFI 0.3.0 Breaks Verifier Logging #196

Closed adamrodger closed 1 year ago

adamrodger commented 2 years ago

Since FFI 0.3.0 (and I assume the move to tracing as the logging library), logging is now broken because it contains all the ASCII colour escape codes again. Here's an excerpt:

Verifier Logs
-------------
\x1b[2m2022-05-24T18:44:11.054823Z\x1b[0m \x1b[32m INFO\x1b[0m ThreadId(17) \x1b[2mpact_verifier\x1b[0m\x1b[2m:\x1b[0m Running provider verification for 'a request to check the api status'
\x1b[2m2022-05-24T18:44:11.055042Z\x1b[0m \x1b[32m INFO\x1b[0m ThreadId(17) \x1b[2mpact_verifier::provider_client\x1b[0m\x1b[2m:\x1b[0m Sending request to provider at http://localhost:9222/
\x1b[2m2022-05-24T18:44:11.055046Z\x1b[0m \x1b[32m INFO\x1b[0m ThreadId(17) \x1b[2mpact_verifier::provider_client\x1b[0m\x1b[2m:\x1b[0m Sending request HTTP Request ( method: GET, path: /stats/status, query: None, headers: Some({"Accept": ["application/json"]}), body: Missing )
\x1b[2m2022-05-24T18:44:11.129385Z\x1b[0m \x1b[32m INFO\x1b[0m ThreadId(17) \x1b[2mpact_verifier::provider_client\x1b[0m\x1b[2m:\x1b[0m Received response: HTTP Response ( status: 404, headers: Some({"content-length": ["0"], "server": ["Kestrel"], "date": ["Tue", "24 May 2022 18:44:10 GMT"]}), body: Empty )
\x1b[2m2022-05-24T18:44:11.129437Z\x1b[0m \x1b[32m INFO\x1b[0m ThreadId(17) \x1b[2mpact_matching\x1b[0m\x1b[2m:\x1b[0m comparing to expected response: HTTP Response ( status: 200, headers: Some({"Content-Type": ["application/json; charset=utf-8"]}), body: Present(127 bytes) )
\x1b[2m2022-05-24T18:44:11.132669Z\x1b[0m \x1b[32m INFO\x1b[0m ThreadId(17) \x1b[2mpact_verifier\x1b[0m\x1b[2m:\x1b[0m Running provider verification for 'a request to check the api uptime'

The output was retrieved using the pactffi_verifier_logs method.

rholshausen commented 2 years ago

Please stay on 0.2.x until we have the logging sorted