Loguru: Python Logging Made Simple and Enjoyable
This repository profile is provided by osrepos.com, an open source repository discovery platform.
Summary
Loguru is a powerful and user-friendly Python library designed to simplify logging. It aims to make logging an enjoyable and straightforward process, eliminating the need for complex configurations. With Loguru, developers can implement robust logging solutions with minimal boilerplate, enhancing debugging and application monitoring.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
Loguru is a Python library that revolutionizes the way developers approach logging. It addresses the common pain points of traditional logging setups, offering a solution that is both simple to use and incredibly powerful. Designed to be ready out-of-the-box, Loguru encourages developers to integrate logging from the very beginning of their projects, making debugging and monitoring significantly easier. It provides a unified, intuitive API, replacing complex configurations with a single logger object and an add() function.
Installation
Getting started with Loguru is straightforward. You can install it using pip:
pip install loguru
Examples
Loguru simplifies many common logging tasks with elegant solutions.
Basic Usage
Start logging instantly without any configuration:
from loguru import logger
logger.debug("That's it, beautiful and simple logging!")
File Logging with Rotation and Retention
Easily log to files, with built-in support for rotation, retention, and compression:
logger.add("file_1.log", rotation="500 MB") # Automatically rotate too big file
logger.add("file_2.log", rotation="1 week") # New file is created each day at noon
logger.add("file_X.log", retention="10 days") # Cleanup after some time
logger.add("file_Y.log", compression="zip") # Save some loved space
Pretty Logging with Colors
Loguru automatically adds colors to your terminal output, enhancing readability. You can customize the style using markup tags:
import sys
logger.add(sys.stdout, colorize=True, format="<green>{time}</green> <level>{message}</level>")
logger.info("This message will be <level>colorful</level>!")
Robust Exception Catching
Ensure all exceptions are caught and logged, even in threads, using the catch() decorator or context manager:
from loguru import logger
@logger.catch
def my_function(x, y, z):
# An error? It's caught anyway!
return 1 / (x + y + z)
my_function(1, 2, -3)
Why Use Loguru?
Loguru stands out for several compelling reasons:
- Simplicity: Eliminates boilerplate code and complex configurations, making logging accessible from the start.
- Rich Features: Offers advanced functionalities like automatic file rotation, retention, compression, modern string formatting, and asynchronous logging.
- Enhanced Debugging: Provides fully descriptive exceptions with stack traces and variable values, significantly speeding up bug identification.
- Developer Experience: Features like colored output, customizable levels, and seamless integration with standard logging make the development process more pleasant.
- Thread and Multiprocess Safety: Ensures log integrity in complex applications.
- Structured Logging: Supports serialization to JSON and contextual binding for easier log analysis.
Links
- GitHub Repository: https://github.com/Delgan/loguru
- Official Documentation: https://loguru.readthedocs.io/en/stable/index.html
- API Reference: https://loguru.readthedocs.io/en/stable/api/logger.html
Related repositories
Similar repositories that may be relevant next.

Vicoa: Agentic IDE for Orchestrating Coding Agents Across Devices
September 29, 2026
Vicoa is an open-source, self-hostable agentic IDE designed to orchestrate a team of coding agents. It enables developers to run and steer multiple AI agents from various devices, including desktop, mobile, and remote servers, providing a unified command center for development workflows.

Open ACE: Self-Hosted AI Coding Agent Workspace and Governance Platform
September 28, 2026
Open ACE is an open-source, self-hosted platform designed for managing AI coding agents within enterprise environments. It provides a unified workspace for various AI tools, enabling remote execution and robust governance features for API keys, costs, and compliance. This platform is ideal for organizations integrating AI coding agents into their development workflows, especially those requiring private deployment and centralized control.

Spec Kitty: Spec-Driven Development for AI Coding Agents and Software Factories
September 27, 2026
Spec Kitty is an open-source CLI that enables spec-driven development for AI coding agents and multi-agent workflows. It transforms product intent into a structured, repo-native AI coding workflow, providing isolated git worktrees and a clear lifecycle for development tasks. This tool helps teams build governed software factories, ensuring visibility and traceability in AI-assisted software development.
Graphon: A Python Graph Execution Engine for Agentic AI Workflows
September 26, 2026
Graphon is an innovative Python-based graph execution engine designed for building agentic AI workflows. It provides a robust framework for orchestrating complex AI tasks, featuring event-driven execution, graph validation, and shared runtime state. This evolving repository already includes a functional engine, built-in nodes, and end-to-end examples for developers.
Source repository
Open the original repository on GitHub.
18 counted GitHub visits