skip to navigation
skip to content

Not Logged In

rainbow_logging_handler 2.0.1

Ultimate Python colorized logger with user-custom color

Latest Version: 2.2.0

Ultimate Python colorized logger.

Quick Usage

This script runs like above screenshot.

import sys
import logging
from rainbow_logging_handler import RainbowLoggingHandler

def main_func():
    # setup `logging` module
    logger = logging.getLogger('test_logging')
    formatter = logging.Formatter("[%(asctime)s] %(name)s %(funcName)s():%(lineno)d\t%(message)s")  # same as default

    # setup `RainbowLoggingHandler`
    handler = RainbowLoggingHandler(sys.stderr, color_funcName=('black', 'yellow', True))

    logger.debug("debug msg")"info msg")
    logger.warn("warn msg")
    logger.error("error msg")
    logger.critical("critical msg")

        raise RuntimeError("Opa!")
    except Exception as e:

if __name__ == '__main__':


Column-by-column colored log

As apparent from above screenshot, each column of logs are differently colored. Even default coloring should make log reading easier.

User custom color

Every column colors are customizable.

formatter = logging.Formatter('%(pathname)s [%(module)s] - %(funcName)s:L%(lineno)d : %(message)s')
handler   = RainbowLoggingHandler(
    # Customizing each column's color
    color_pathname=('black', 'red'  , True), color_module=('yellow', None, False),
    color_funcName=('blue' , 'white', True), color_lineno=('green' , None, False),
logger.addHandler(handler)"hello custom world")

Above code produces output like this.

High portability

Linux, BSD, Mac OS, and Windows are supposed to be supported.

Runs with both Python 2.6 or higher & Python 3.2 or higher.


Install from PyPI

$ pip install rainbow_logging_handler

Install from Github repo

$ git clone
$ cd rainbow_logging_handler
$ ./ install


Mikko Ohtamaa <>, Sho Nakatani <>

And special thanks to 10sr for advice.


This is free and unencumbered public domain software. For more information, see <> or the accompanying LICENSE.txt file.

File Type Py Version Uploaded on Size (md5) Source 2013-12-05 13KB
  • Downloads (All Versions):
  • 45 downloads in the last day
  • 1641 downloads in the last week
  • 2677 downloads in the last month