colorlog
Add colours to the output of Python's logging module.
Decision gist · record as of 2026-08-14
Yes. colorlog is a stable, well-maintained library with low install friction, no known vulnerabilities, and a permissive license. It solves a common problem (readable colored logs) with a simple API that integrates cleanly into Python's standard logging. Install it if you want colored terminal output without managing ANSI codes yourself.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.6 or higher; colorama is automatically included on Windows for color support.
- Low friction install with a single runtime dependency (colorama).
- Actively maintained with recent releases; requires Python 3.6 or higher.
License · maintenance · safety
MIT License (permissive) — MIT License (permissive) — you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
last release 2026-07-23 (22 days) · last repo commit 2026-07-23 · 967 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 65,680,082 downloads/mo, #487 on PyPI
Alternatives
Verify before relying
pip install colorlog
import colorlog
handler = colorlog.StreamHandler()
handler.setFormatter(colorlog.ColoredFormatter())
logger = colorlog.getLogger('example')
logger.addHandler(handler)- Whether the package works correctly with all terminal emulators and color depth settings mentioned in the description.
What it is and what it does
colorlog extends Python's standard logging.Formatter to inject ANSI color codes into log output based on log level. It wraps the built-in logging module and provides a ColoredFormatter class that automatically detects whether the output stream is a TTY and disables colors on non-TTY streams unless explicitly forced. On Windows, it depends on colorama to handle color initialization.
The package lets you map log levels to colors (DEBUG as cyan, ERROR as red, etc.), use secondary color mappings for additional formatting flexibility, and reference color codes directly in format strings. It supports standard ANSI colors, bright variants, 256-color palette indices, and composite codes like bold or background colors. The library has been maintained for over a decade and is in stable, production-ready state.
Use it for
- Add visual distinction to log levels in CLI applications so errors and warnings stand out immediately.
- Configure logging in development environments to make debugging easier by color-coding different message types.
- Set up structured logging with custom format strings that use both level-based and secondary colors for richer output.
- Integrate colored logging into existing Python applications using dictConfig or fileConfig without major refactoring.
- Support custom log levels with corresponding colors in specialized logging setups.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
colorlog is a stable, well-maintained library with low install friction, no known vulnerabilities, and a permissive license. It solves a common problem (readable colored logs) with a simple API that integrates cleanly into Python's standard logging. Install it if you want colored terminal output without managing ANSI codes yourself.
Install
colorlog on PyPI
Before you install
Low friction install with a single runtime dependency (colorama). Actively maintained with recent releases; requires Python 3.6 or higher.
Requires Python 3.6 or higher; colorama is automatically included on Windows for color support.
License in practice
MIT License (permissive) — you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install colorlog
import colorlog
handler = colorlog.StreamHandler()
handler.setFormatter(colorlog.ColoredFormatter())
logger = colorlog.getLogger('example')
logger.addHandler(handler)
Verify before relying
- Whether the package works correctly with all terminal emulators and color depth settings mentioned in the description.
Package facts
| License | MIT License permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagecolorama |
| Maintenance | Actively maintained 22 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 65,680,082 / month, #487 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: TerminalsTopic :: Utilities |
Evidence: colorlog-6.12.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “python logging colors”
- colorlogAdds colored output to Python's standard logging module,…
- coloredlogsAdds colored output to Python's standard logging module using ANSI…
- hydra-colorlogIntegrates colorlog with Hydra to provide colored logging output for…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also coloredlogs · hydra-colorlog · termcolor · pretty-errors · simple-colors · inform · crayons · pastel · python-simple-logger · ansicolors