Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

Nice colorful formatters for Python logging.

Project description Latest PyPI version Number of PyPI downloads Supported Python versions Development Status License

Provide formatters to nicely display colorful logging output on the console.

Fork this project on GitHub

Right now, it contains only one formatter, coloring log lines depending on the log level and adding nice line prefixes containing logger name, but future plans are to add more formatters and allow better ways to customize them.

Example usage

from nicelog.formatters import ColorLineFormatter
import logging
import sys

logger = logging.getLogger('foo')

handler = logging.StreamHandler(sys.stderr)


logger.debug('Debug message')'Info message')
logger.warning('Warning message')
logger.error('Error message')
logger.critical('Critical message')

Example output

Here it is, in all its glory:


If you want to see what it looks like in 256color mode, with all the fields enabled:


Powerline font support

You can set the HAS_POWERLINE_FONT environment variable to a non-null value in order to tell the formatter to use powerline-style symbols (specifically, the “arrow” thing).



  • Prevent failure in case the TERM environment variable is not set (PR #1)


  • Added support for message_inline argument. If set to False, messages will be displayed on their own line (useful when enabling a lot of information)


  • Added support for showing more information:
    • record date
    • file name / line number
    • module / function


  • Added support for nicer colors in 256-color mode
  • Removed dependency from termcolor (now shipping better implementation)

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
nicelog-0.1.9.tar.gz (4.7 kB) Copy SHA256 hash SHA256 Source None Dec 4, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page