pact-foundation/pact-net

RFC: Update debugging docs at https://docs.pact.io/help/enabling-debug-logging

Opened this issue · 3 comments

Previous issues
n/a

Is your feature request related to a problem? Please describe.
Documentation

Describe the solution you'd like
Update the documentation at https://docs.pact.io/help/enabling-debug-logging for Pact .NET to help users understand how to set the appropriate log level, and where to retrieve the output.

Breaking Changes
n/a

Potential Downsides/Caveats
n/a

Describe alternatives you've considered
n/a

Additional context
When people raise requests for issues, particularly in our community Slack workspace, it's helpful to point users at simple location applicable to all client SDKs where they can understand how to produce relevant DEBUG logs for assistance.

Yeah cool 👍 It's already listed in the Readme so should be easy to centralise.

Thanks Adam. In case it helps, the gaps that seem to come up consistently in slack questions:

  1. How to enable logging (this seems straightforward enough, consumer example and provider one (the readme shows the provider only I think)
  2. How to get access to the logs themselves

Number (2) is where I struggle to provide useful advice. I tend to run tests/code from my terminal, wherstdout and stderr is usually captured. But I think when running with IDEs and/or test framework (nunit/xunit) the logs seem to be harder to locate for some.

Is the concept of an Outputter a common one in .NET? I recall this confusing some, but admittedly this was a while back so I might be extrapolating too far.

Ah yeah the logs output literally in the IDE output window of the test. On .Net, the tests run in parallel so they don't write directly to stdout as they go otherwise they'd all interleave.

Instead each test captures the output separately and reports to the output window for that test. Probably people just need to scroll down a little bit more, because the pact logs are appended after any output from the test itself.

I keep my test window on a vertical split so I get the full output for each test (which I think is the default) but if anyone has it in a horizontal split perhaps they go off the bottom of the screen and require scrolling down.

In CI or console they all end up on stdout though, they're just written a test at a time so they don't interleave.