Formatter allowing for colored output in log messages
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
docs Bump version to 1.0.6 and update documentation Nov 16, 2018
tests Added unittests for dark colors Nov 16, 2018
.gitignore update .gitignore Nov 2, 2017
Makefile Added dark color options Nov 15, 2018 Bump version - update readme Feb 12, 2018
copying Add licensing info Jan 6, 2017 Bump version to 1.0.6 and update documentation Nov 16, 2018


When making command line interfaces, it's often useful to colorize the output to emphasize salient pieces of information or otherwise enhance the user experience. Unfortunately it's quite cumbersome to add colorized outputs to Python log messages.


The ColorFormatter is a logging formatter that parses your log messages and adds color codes to the log messages.



The ColorStripper formatter is the inverse of the ColorFormatter. It strips the color information from your messages so that you can safely log to a file.


I'm on pypi!

$ pip install log_color


  • Simple to use
  • No external dependencies
  • Compatibility with Python2.6, Python 2.7, Python 3.x, PyPy


This project uses a Makefile for various tasks. Some of the available tasks are listed below.

  • make clean - Clean build artifacts out of your project
  • make test - Run Unit Tests (using nose & tox)
  • make sdist - Build a Python source distribution
  • make wheel - Build a Python wheel
  • make docs - Build the Sphinx documentation
  • make publish - publish any artifacts in dist/* using twine
  • make pep8 - Get a pep8 compliance report about your code
  • make - Equivalent to make test pep8 docs sdist rpm

LogColor honors the NO_COLOR environment variable.