Metadata-Version: 2.1
Name: earnbase-common
Version: 0.1.0
Summary: Common utilities for Earnbase services
Keywords: logging,utilities,microservices
Author-Email: Earnbase Team <dev@earnbase.io>
License: MIT
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: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Logging
Project-URL: Homepage, https://github.com/earnbase/earnbase-common
Project-URL: Documentation, https://github.com/earnbase/earnbase-common#readme
Project-URL: Repository, https://github.com/earnbase/earnbase-common.git
Project-URL: Issues, https://github.com/earnbase/earnbase-common/issues
Requires-Python: >=3.9
Requires-Dist: structlog>=23.2.0
Requires-Dist: pydantic>=2.5.2
Requires-Dist: pydantic-settings>=2.1.0
Description-Content-Type: text/markdown

# Earnbase Common

Common utilities for Earnbase microservices.

## Features

- Structured logging with JSON format
- Log rotation and error logging
- Development and production logging modes
- Sensitive data filtering
- Service information injection

## Installation

```bash
pip install earnbase-common
```

## Usage

### Basic Usage

```python
from earnbase_common.logging import setup_logging, get_logger

# Configure logging
setup_logging(
    service_name="my-service",
    log_file="logs/my-service.log",
    log_level="INFO",
    debug=False
)

# Get logger
logger = get_logger(__name__)

# Use logger
logger.info("Service started", extra={"version": "1.0.0"})
```

### Configuration

The logging system can be configured with the following parameters:

- `service_name`: Name of the service
- `log_file`: Path to log file
- `log_level`: Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
- `debug`: Debug mode flag (enables colored console output)

## Development

1. Clone the repository
2. Install dependencies with PDM:
```bash
pdm install
```

3. Run tests:
```bash
pdm run test
```

## License

MIT License 