Metadata-Version: 2.4
Name: litewave-audit-lib
Version: 0.1.2
Summary: A lightweight audit logging library with pluggable backends
Home-page: https://github.com/litewave/litewave-audit-lib
Author: Sonu Sudhakaran
Author-email: Sonu Sudhakaran <sonu@litewave.ai>
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: nats-py>=2.0.0
Dynamic: author
Dynamic: home-page
Dynamic: requires-python

# Litewave Audit Library

Internal audit logging library for Litewave services.

## Usage

```python
from litewave_audit_lib import get_logger

# Get a logger with NATS backend
logger = get_logger(
    nats_connection_url="nats://username:password@your-nats-server:4222"
)

# Log an audit event
logger.log(
    who="user@email.com",
    resource="document",
    action="view",
    location="cloud",
    request_context={"ip": "127.0.0.1"},
    context={"document_id": "doc123"},
    client={}
```

## Features

- Automatic reconnection handling
- Connection retry logic
- Proper error handling and logging
- Type hints for better IDE support
- Automatic cleanup of NATS connections

## Dependencies

- nats-py (for NATS backend)
