Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (
Help us improve Python packaging - Donate today!

Logging utilities

Project Description

Simple django-like color logging for python project.

The original code for this project was written by Vinay Sajip and is hosted at: the original documentation for this project is at:

pthon-color-logger forked this project at version 0.3.3 to add support for custom coloring in classses derived from ColorizingStreamHandler.


pip install python-color-logger


#!/usr/bin/env python
import logging
import logging.config

from logutils.colorize import ColorizingStreamHandler

class ColorHandler(ColorizingStreamHandler):
    def __init__(self, *args, **kwargs):
        super(ColorHandler, self).__init__(*args, **kwargs)
        self.level_map = {
                # Provide you custom coloring information here
                logging.DEBUG: (None, 'blue', False),
                logging.INFO: (None, 'green', False),
                logging.WARNING: (None, 'yellow', False),
                logging.ERROR: (None, 'red', False),
                logging.CRITICAL: ('red', 'white', True),
    'disable_existing_loggers': True,
        'console': {
            'level': 'DEBUG',
            'formatter': 'detailed',
            'stream': 'ext://sys.stdout',
    'formatters': {
        'detailed': {
            'format': '%(asctime)s %(module)s line:%(lineno)-4d %(levelname)-8s %(message)s',
    'loggers': {
        'info': {

L = logging.getLogger('info')

L.debug("Hello world") # output should be in blue"Hello world") # output should be in green
L.warn("Hello world") # output should be in yellow
L.error("Hello world") # output should be in red
L.critical("Hello world") # output should be in white with a red back ground
Release History

Release History

This version
History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
python-color-logger-0.3.4.tar.gz (16.8 kB) Copy SHA256 Checksum SHA256 Source Oct 23, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting