Metadata-Version: 2.4
Name: pretty-loguru
Version: 1.1.3
Summary: A Loguru-based logger with Rich panels, ASCII art headers, blocks and more.
Author-email: JonesHong <latte831104@gmail.com>
License: MIT License
        
        Copyright (c) 2025 JonesHong
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
        
Project-URL: Source, https://github.com/JonesHong/pretty-loguru
Project-URL: Tracker, https://github.com/JonesHong/pretty-loguru/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: loguru>=0.6.0
Requires-Dist: rich>=12.0.0
Requires-Dist: art>=5.0.0
Requires-Dist: pyfiglet>=1.0.1
Requires-Dist: matplotlib>=3.7.0
Requires-Dist: python-dateutil>=2.8.2
Dynamic: license-file

# Pretty-Loguru 🎨

[![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![PyPI Version](https://img.shields.io/pypi/v/pretty-loguru.svg)](https://pypi.org/project/pretty-loguru/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)

An enhanced Python logging library built on [Loguru](https://github.com/Delgan/loguru), integrating [Rich](https://github.com/Textualize/rich) and ASCII art to make logging more elegant and intuitive.

## ✨ Features

- 🎨 **Rich Block Logging** - Display structured logs using Rich panels
- 🎯 **ASCII Art Headers** - Generate eye-catching ASCII art titles
- 🔥 **One-Click Setup** - Simple configuration for both file and console logging
- 🚀 **FastAPI Integration** - Perfect integration with FastAPI and Uvicorn
- 📊 **Preset Configurations** - Best practices for development, production, and testing
- 🛠️ **Highly Customizable** - Support for custom formats, colors, and rotation strategies

## 📦 Installation

```bash
pip install pretty-loguru
```

## 🚀 Quick Start

### Basic Usage

```python
from pretty_loguru import create_logger

# Create logger
logger = create_logger("my_app")

# Basic logging
logger.info("Application started")
logger.success("Operation completed successfully")
logger.warning("This is a warning")
logger.error("An error occurred")

# Rich blocks
logger.block("System Status", "Everything is running smoothly", border_style="green")

# ASCII art
logger.ascii_header("WELCOME", font="slant")
```

### Using Configuration Objects

```python
from pretty_loguru import create_logger, LoggerConfig, ConfigTemplates

# Use preset templates
config = ConfigTemplates.production()
logger = create_logger("app", config=config)

# Custom configuration
custom_config = LoggerConfig(
    level="DEBUG",
    log_path="logs",
    rotation="1 day",
    retention="7 days"
)
logger = create_logger("debug_app", config=custom_config)

# Update existing logger
config.update(level="INFO")  # All loggers using this config will update
```

### Multi-Logger Management

```python
# Create multiple loggers
auth_logger = create_logger("auth", level="INFO")
db_logger = create_logger("database", level="DEBUG")
api_logger = create_logger("api", level="WARNING")

# Unified configuration management
config = LoggerConfig(level="INFO", log_path="logs")
loggers = config.apply_to("auth", "database", "api")

# Dynamic update for all loggers
config.update(level="DEBUG")  # All loggers update simultaneously
```

## 📖 Documentation

Full documentation available at: [https://joneshong.github.io/pretty-loguru/](https://joneshong.github.io/pretty-loguru/)

- [User Guide](docs/en/guide/index.md)
- [API Reference](docs/en/api/index.md)
- [Examples](examples/README.md)
- [Configuration Guide](docs/en/guide/custom-config.md)

## 🤝 Contributing

Issues and Pull Requests are welcome!

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
