Conversation
Co-authored-by: JP-Ellis <[email protected]>
|
@copilot Please also update the existing provider and consumer docs to include a brief description of how to enable logging, and link to the new |
Added logging sections to both consumer.md and provider.md with links to the detailed logging documentation. Each section includes a brief explanation and the recommended pytest fixture setup. See commit d0ebef5. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1303 +/- ##
====================================
Coverage 52% 52%
====================================
Files 32 32
Lines 3744 3744
====================================
Hits 1967 1967
Misses 1777 1777
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Co-authored-by: JP-Ellis <[email protected]>
d0ebef5 to
68f58ed
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive documentation for configuring FFI logging in Pact Python, addressing the architectural constraint that the Rust FFI cannot directly interface with Python's standard logging module.
Key changes:
- Created a dedicated logging documentation page with complete configuration guidance
- Added logging sections to consumer and provider documentation for discoverability
- Updated navigation to include the new logging page
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| docs/logging.md | New comprehensive logging documentation covering basic and advanced configuration, troubleshooting, and API references |
| docs/consumer.md | Added logging section with pytest fixture example for debugging mock service issues |
| docs/provider.md | Added logging section with pytest fixture example for debugging provider verification |
| docs/SUMMARY.md | Added logging page to documentation navigation menu |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Summary
This PR adds comprehensive documentation on how to configure FFI (Foreign Function Interface) logging in Pact Python. While the Python code uses the standard library
loggingmodule, the underlying Rust FFI cannot interface with it directly, requiring separate configuration.Changes
New Documentation Page
Created
docs/logging.mdcovering:pact_ffi.log_to_stderr()to direct FFI logs to standard errorconftest.pylog_to_buffer()for capturing logs to internal memory, with notes about features planned but not yet implementedUpdates to Existing Documentation
Added brief logging sections to both
docs/consumer.mdanddocs/provider.md:Example
The recommended setup for pytest users:
Navigation Update
Updated
docs/SUMMARY.mdto include the new Logging page in the documentation menu.Motivation
Users often struggle to understand why Pact FFI logs don't appear when using Python's standard logging configuration. This documentation addresses that confusion by:
Fixes #1302
Original prompt
Fixes #1302
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.