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

feature: Write logs into a file #75

Open
surpher opened this issue Oct 3, 2021 · 0 comments
Open

feature: Write logs into a file #75

surpher opened this issue Oct 3, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@surpher
Copy link
Owner

surpher commented Oct 3, 2021

🗣 Context

Currently the only way to display some logging is by setting an environment variable. It would be good to have the logs of interactions with the mock server written in a file.

💬 Narrative

When running pact tests
I want to have logs written into a file
So that I can debug locally and on CI much easier

📝 Notes

PactSwiftMockServer exposes a pactffi method that tells pactffi_mock_server to write the log buffer into a file.

🏗 Design

  • Exposes the interface ie MockService.init(log: URL? = nil)
  • Passes do write the log signal to PactSwiftMockServer package and into pactffi.
  • Uses the same base default directory for contract if no override provided (eg: /tmp/pacts/logs)

✅ Acceptance Criteria

GIVEN a valid URL to a log file is provided at MockService.init
WHEN pact tests finish
THEN a log file is generated at provided URL

GIVEN MockService is instantiated without an URL to a log file
WHEN pact tests finish
THEN a log file is generated at defaultPactsDir/logs

🚫 Out of Scope

@surpher surpher added the enhancement New feature or request label Oct 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant