Skip to content

Document how to configure FFI logging #1302

@JP-Ellis

Description

@JP-Ellis

Have you read the Contributing Guidelines on issues?

Description

Improve the documentation as to how logging can be configured for the FFI. Specifically, it should:

  1. Direct users to the pact_ffi.log_to_stderr function

  2. Advise that the FFI logging can only be initialised once, and as such, is probably best placed in a fixture within conftest.py:

    import pytest
    import pact_ffi
    
    @pytest.fixture(autouse=True, scope="session")
    def pact_logging():
        pact_ffi.log_to_stderr("INFO")
  3. Advise that more advanced configuration can be set up (such as logging to an internal buffer and retrieving logs on demand).

Motivation

While the Python code uses the standard library logging, the underlying FFI cannot interface with that. This is why there's a need to configure logging first.

Have you tried building it?

No response

Self-service

  • I'd be willing to contribute this feature to Pact Python myself.

Metadata

Metadata

Assignees

Labels

area:documentationRelating to the documentationarea:ffiRelating to the FFIdifficulty:easyA simple task appropriate for newcomers to the codebase

Type

No type

Projects

Status

✅ Completed

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions