Metadata-Version: 2.4
Name: br-logging-and-profiling
Version: 0.1.0
Summary: Loguru-based logging facade, correlation IDs, and profiling decorator extracted from Forecasting-sidecar3.
Author: Brais Diaz
License: MIT
Project-URL: Homepage, https://github.com/brais/br-logging-and-profiling
Project-URL: Repository, https://github.com/brais/br-logging-and-profiling
Keywords: logging,profiling,loguru,colorama,ray-id
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: loguru>=0.7.0
Requires-Dist: colorama>=0.4.6
Requires-Dist: pandas>=2.0
Requires-Dist: numpy<2.2,>=1.24
Provides-Extra: dev
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: ruff>=0.6; extra == "dev"
Requires-Dist: gitpython; extra == "dev"

# br_logging_and_profiling

Reusable logging/profiling/tracing package extracted from Forecasting-sidecar3.

## Current state

- Logging: Loguru + colorama via `br_py_log_n_profile.do_log.log_it`
- Profiling: `profile_it` decorator (wall-clock timing, colored console output)
- Correlation IDs: `ray_id` via `contextvars.ContextVar`

## Planned

- `tracing/` module: `init_tracing()`, `traced` decorator (OTel span replacement for `profile_it`), `@counted`/`@timed_metric` for hot-loop metrics
- Backend: Prometheus + Jaeger + Grafana + OTel Collector
- Migration phases: Phase 0 (deps/config) → Phase 1 (core tracing) → Phase 2 (migrate by layer) → Phase 3 (metrics) → Phase 4 (backend stack)

## Install

```bash
pip install br-logging-and-profiling
```

## Development

```bash
pip install -r requirements-dev.txt
pre-commit install
pytest -m unit
```
