Metadata-Version: 2.4
Name: logfn
Version: 0.0.1
Summary: Structured logging for Python with pluggable pipelines and transports
Author: 21n
License: MIT
Project-URL: Repository, https://github.com/21nCo/super-functions
Project-URL: Issues, https://github.com/21nCo/super-functions/issues
Keywords: logging,structured-logging,json,observability
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Logging
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27.0
Requires-Dist: typing-extensions>=4.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: respx>=0.21.0; extra == "dev"

# logfn-python

Structured logging for Python with pluggable pipelines and transports.

## Features

- **Structured Logging**: JSON-based log events with consistent schema
- **Log Levels**: trace, debug, info, warn, error, fatal
- **Child Loggers**: Create scoped loggers with inherited context
- **Pipeline Stages**: Pluggable event processing (redaction, enrichment, sampling)
- **Multiple Sinks**: Console (pretty/JSON), HTTP (batched with retry)
- **Type Hints**: Fully typed with Python type hints

## Installation

```bash
pip install logfn
```

## Quick Start

```python
from logfn import dev_logger

logger = dev_logger("my-app")

logger.info("Application started", version="1.0.0")
logger.warn("Deprecated API used", api="/old-endpoint")
logger.error("Request failed", status_code=500, path="/api/users")
```

## Basic Usage

### Creating a Logger

```python
from logfn import create_logger, SinkConsole

logger = create_logger(
    name="my-service",
    level="info",
    sinks=[SinkConsole(json=True)],
)

logger.info("User logged in", user_id="123", email="user@example.com")
```
