Metadata-Version: 2.4
Name: devlogbus
Version: 1.3.1
Summary: Python SDK for publishing records to DevLogBus.
Author: Dan Sherwin
License-Expression: MIT
Project-URL: Homepage, https://github.com/dan-sherwin/DevLogBus
Project-URL: Repository, https://github.com/dan-sherwin/DevLogBus
Project-URL: Issues, https://github.com/dan-sherwin/DevLogBus/issues
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# DevLogBus Python SDK

Standard-library Python SDK for publishing records to the DevLogBus HTTP API.

```bash
python3 -m pip install /path/to/DevLogBus/sdk/python
```

```python
from devlogbus import DevLogBusClient, redact_attrs

devlog = DevLogBusClient(
    source="checkout_worker",
    redactor=redact_attrs(["authorization", "token"]),
)

devlog.publish(
    level="INFO",
    message="checkout started",
    attrs={"request_id": "req-1"},
)
```

The default endpoint is `http://127.0.0.1:7423`. Pass `endpoint` explicitly for
other local or trusted-network daemons.

Use the logging handler when you want normal `logging` records to publish:

```python
import logging
from devlogbus import DevLogBusLoggingHandler

logger = logging.getLogger("checkout")
logger.addHandler(DevLogBusLoggingHandler(source="checkout_worker"))
logger.warning("payment provider slow")
```

Run tests from the repository root:

```bash
python3 -m unittest discover -s sdk/python/tests
```
