Ezplog
ezplog is a modern Python logging framework combining Rich console rendering and loguru file logging with an explicit app/lib compatibility model.
2.4 update: import from
ezploginstead ofezpl. The CLI now uses Typer, and console rendering has been refreshed.
📦 Installation
# With uv (recommended)
uv add ezplog
# With pip
pip install ezplog
Or from source:
git clone https://github.com/neuraaak/ezplog.git
cd ezplog
uv pip install -e . # uv
pip install -e . # pip
🚀 Quick Start
from ezplog import Ezpl
# Initialize once in the application entrypoint
ezpl = Ezpl(log_file="app.log", hook_logger=True, hook_printer=True)
printer = ezpl.get_printer()
logger = ezpl.get_logger()
# Console output (Rich formatting)
printer.info("Information message")
printer.success("Operation completed!")
printer.warning("Warning message")
# File logging (loguru)
logger.info("Logged to file")
# Advanced features
printer.wizard.success_panel("Success", "Operation completed")
printer.wizard.table([{"Name": "Alice", "Age": 30}], title="Users")
🎯 Key Features
- ✅ Singleton Pattern: One global instance for the whole application
- ✅ Rich Console Output: Colors, panels, tables, JSON, and progress bars
- ✅ File Logging: Rotation, retention, and compression via loguru
- ✅ Explicit Compatibility Hooks: Fine control between app mode and lib mode
- ✅ Configuration Management: Arguments, environment variables, file, and runtime updates
- ✅ CLI Tools: Commands for logs and configuration
- ✅ Full Type Hints: Complete typing support for IDEs and linters
- ✅ Robust Fallbacks: Safe behavior even with problematic message objects
📚 Documentation
Complete documentation is available at neuraaak.github.io/ezplog
| Section | Description |
|---|---|
| Getting Started | Installation, basic usage, and first steps |
| Concepts | Design rationale, trade-offs, and architecture |
| API Reference | Complete API documentation with examples |
| CLI Reference | Command-line interface guide |
| User Guides | Configuration, development, and testing guides |
| Examples | Practical examples and demonstrations |
🧪 Testing
Comprehensive test suite covering unit, integration, and robustness scenarios. Coverage is generated automatically in documentation workflows.
# Install dev dependencies
uv sync --extra dev
# Run all tests
uv run pytest tests/
# Run specific test types
uv run pytest tests/unit/
uv run pytest tests/integration/
uv run pytest tests/robustness/
# With coverage
uv run pytest --cov=src/ezplog --cov-report=term --cov-report=html
See Testing Guide for complete details.
🛠️ Development Setup
For contributors and developers:
# Install in development mode with all dependencies
uv sync --extra dev --extra docs --extra test
# Install pre-commit hooks (code formatting, linting)
uv run pre-commit install
# Run quality checks
uv run ruff check src tests
uv run ty check
Source code uses a src/ layout (src/ezplog).
Git Hooks:
- pre-commit: Automatically formats and lints code before commit
See Development Guide for full details.
🎨 Main Components
Ezpl: Singleton main class for centralized logging managementEzPrinter(alias:Printer): Rich-based console output with pattern formatEzLogger(alias:Logger): loguru-based file logging with rotation supportRichWizard: Advanced Rich display (panels, tables, JSON, progress bars)ConfigurationManager: Centralized configuration management
📦 Dependencies
- rich>=13.0.0 – Beautiful console output and formatting
- loguru>=0.7.2 – Modern and powerful file logging
- typer>=0.29.3 – Typed CLI with Rich help
🔧 Quick API Reference
from ezplog import Ezpl, Printer, Logger
ezpl = Ezpl(hook_logger=True, hook_printer=True)
printer: Printer = ezpl.get_printer()
logger: Logger = ezpl.get_logger()
# Console methods
printer.info(), printer.success(), printer.warning(), printer.error()
printer.trace(), printer.exception()
printer.tip(), printer.system(), printer.install() # Pattern methods
printer.wizard.panel(), printer.wizard.table(), printer.wizard.json()
# File logging
logger.info(), logger.debug(), logger.warning(), logger.error()
logger.trace(), logger.exception()
# Configuration
ezpl.set_level("DEBUG")
ezpl.configure(log_rotation="10 MB", log_retention="7 days")
ezpl.set_compatibility_hooks(hook_logger=True, logger_names=["vendor.payment"])
💻 CLI Usage
The ezpl command provides tools for log inspection and configuration management.
# View recent log entries
ezpl logs view --lines 50
# Search for errors across log files
ezpl logs search --pattern "error|exception" --level ERROR
# Export logs to JSON
ezpl logs export --format json --output logs.json
# Read or update configuration
ezpl config get --show-env
ezpl config set log-level DEBUG
# Open the documentation site
ezpl docs
See the CLI Reference for the full command and option listing.
🛡️ Robustness
Ezpl is designed to never crash, even with problematic input:
- Automatic string conversion for non-string messages
- Robust error handling in formatters
- Safe handling of special characters and Unicode
- Graceful fallbacks for all error cases
📝 License
MIT License – See LICENSE file for details.
🔗 Links
- Documentation: https://neuraaak.github.io/ezplog/
- Repository: https://github.com/neuraaak/ezplog
- PyPI: https://pypi.org/project/ezplog/
- Issues: GitHub Issues
ezplog - Modern, typed, robust and beautiful logging for Python.
Metadata
Release files for ezplog 2.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ezplog-2.4.1.tar.gz | 170.8 kB | Without provenance | Details for ezplog-2.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ezplog-2.4.1-py3-none-any.whl | Python 3 | none | any | Details for ezplog-2.4.1-py3-none-any.whl |
Total release size: 255.5 kB
Release files / ezplog-2.4.1.tar.gz
| Download URL | ezplog-2.4.1.tar.gz |
|---|---|
| Size | 170.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
990475073563f0bb6828e7b6ee561680eec6e1fdc0e2b4b1789ef5e62ed8a7b5
|
|
BLAKE2b-256 checksum How to use checksums |
b3b3fe68ff85bcf2ae51e3588f9c67652fa29d98555cff6ef2388ca8c6c2c809
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / ezplog-2.4.1-py3-none-any.whl
| Download URL | ezplog-2.4.1-py3-none-any.whl |
|---|---|
| Size | 84.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec796bcaced7ca4d8987f53afcef7c2a1bddb96621515bc3576b5ffbf0bd6662
|
|
BLAKE2b-256 checksum How to use checksums |
d828d5879f2978f5c1b8404a5cedcccaf7c9d77fa4d0afcb7a682faba715fe39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for ezplog 2.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.