Loguru
github.com
1
Leaving SiteNav
External Link Disclaimer
You are about to visit github.com. This website is not operated by us. We are not responsible for its content or privacy practices.
About this website
Loguru is a Python logging library designed to make logging in Python applications effortless, flexible, and enjoyable, created and maintained by Delgan (Colin Bounouar). The name is a portmanteau of Log and surplus, reflecting its goal of providing everything you need for logging with zero configuration. Unlike the standard library logging module, which requires verbose boilerplate code to set up handlers, formatters, filters, and loggers, Loguru provides a single pre-configured global logger object that works out of the box with sensible defaults. The core API consists of a single logger object with methods for different severity levels (logger.debug, logger.info, logger.success, logger.warning, logger.error, logger.critical), each accepting a message string with Python format-style placeholders for lazy evaluation. Key features include: zero-configuration setup with beautiful default formatting (colorized output with timestamps, log level, module, function, line number, and the message), automatic exception detection with full traceback and variable values via the logger.catch decorator, structured logging with serialization to JSON via the serialize parameter, file rotation based on size, time, or compression (e.g., rotation every 50 MB or every day, with optional gzip compression of old logs), retention policies for automatic cleanup of old log files, asynchronous and thread-safe logging, support for logging to multiple sinks simultaneously (files, stdout, stderr, syslog, HTTP endpoints, or any callable), colorized output with 256-color and RGB support, structured log records with extra contextual data via the bind method, and filtering based on severity level, module name, or custom filter functions. As of 2026, Loguru has over 20,000 GitHub stars and is licensed under the MIT license.
Tags & Categories
Categories
Tags
Statistics
1
Views
0
Clicks
0
Like
0
Dislike