Skip to content

pretty-loguruEnhanced Python Logging Library

Based on Loguru, integrated with Rich and ASCII Art for more elegant log outputs.

pretty-loguru

🚀 Quick Installation

bash
pip install pretty-loguru

⚡ Quick Start

python
from pretty_loguru import create_logger

# Initialize the logging system with one line of code
logger  = create_logger(
    name="en_demo",
    log_path="my_logs",
    level="INFO"
)

# Start using various logging features
logger.info("Application started successfully")
logger.success("Database connection is normal")
logger.warning("Memory usage is high")

# Rich Block Log
logger.block(
    "System Status Summary",
    [
        "CPU Usage: 45%",
        "Memory Usage: 60%", 
        "Disk Space: 120GB available",
        "Network Connection: Normal"
    ],
    border_style="green",
    log_level="INFO"
)

# ASCII Art Header
logger.ascii_header(
    "SYSTEM READY",
    font="slant",
    border_style="blue"
)

📸 Showcase

Basic Log Output

Basic Example Terminal

Rich Block Log

Rich Block Example

ASCII Art Header

ASCII Art Example

🎯 Why choose pretty-loguru?

  • 🎨 Visualization-First: Rich visual elements make logs no longer monotonous.
  • ⚡ Out-of-the-Box: Minimalist API design, get started with just a few lines of code.
  • 🔧 Highly Flexible: Supports multiple output formats and custom configurations.
  • 🌐 Framework Integration: Perfect support for mainstream frameworks like FastAPI and Uvicorn.
  • 📦 Production-Ready: Built-in enterprise-level features like log rotation, compression, and cleanup.

🚀 Next Steps

📄 License

This project is licensed under the MIT License.

Released under the MIT License.