Metadata-Version: 2.4
Name: drf-minimal-api-logger
Version: 0.1.0
Summary: A lightweight, beautiful execution time logger middleware for Django REST Framework.
Author-email: Elgun Huseynzade <your-email@example.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/husubayli/drf-minimal-api-logger
Project-URL: Bug Tracker, https://github.com/husubayli/drf-minimal-api-logger/issues
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.0
Classifier: Framework :: Django :: 4.1
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
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: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django>=4.0
Dynamic: license-file

# drf-minimal-api-logger

A lightweight, dependency-free, and beautifully formatted execution time logger middleware for Django and Django REST Framework.

## Features

- 🚀 **Zero Dependencies** — Works out-of-the-box with standard Django, no extra packages needed.
- 🎨 **Color-Coded Output** — Highlights HTTP statuses: Green for 2xx, Yellow for 4xx, Red for 5xx.
- ⏱️ **Performance Tracking** — Measures exact request-response lifecycle duration in milliseconds.

## Installation

```bash
pip install drf-minimal-api-logger
```

## Setup

Add `drf_minimal_api_logger` to your `INSTALLED_APPS` and the middleware to `MIDDLEWARE` in `settings.py`:

```python
INSTALLED_APPS = [
    ...
    'drf_minimal_api_logger',
]

MIDDLEWARE = [
    ...
    'drf_minimal_api_logger.middleware.MinimalAPILoggerMiddleware',
]
```

## Example Output

```
[DRF-LOGGER] GET /api/users/ -> 200 (12.34ms)
[DRF-LOGGER] POST /api/login/ -> 400 (5.67ms)
[DRF-LOGGER] DELETE /api/item/1/ -> 500 (3.21ms)
```

Status codes are color-coded in the terminal:
- **Green** — 2xx Success
- **Yellow** — 4xx Client Error
- **Red** — 5xx Server Error

## Requirements

- Python >= 3.8
- Django >= 4.0

## License

MIT License. See [LICENSE](LICENSE) for details.
