Skip to main content

ColorFormatter class for logging module.

Project description

cologging

Description

Add some colors to your logs in one simple step!

Quickstart

  • Add the formatter to your stream handler and enjoy rainbowy output
import cologging
import logging

log = logging.getLogger('Colorful')

formatter = cologging.ColorFormatter('%(levelname)s: %(message)s')

sh = logging.StreamHandler()
sh.setFormatter(formatter)

log.addHandler(sh)
log.setLevel(logging.DEBUG)

log.debug('Debug in blue')
log.info('Info in green')
log.warning('Warning in yellow')
log.error('Error in red')
  • As you can see the colors are not added when output is redirected
demo

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cologging-0.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file cologging-0.1-py3-none-any.whl.

File metadata

  • Download URL: cologging-0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for cologging-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 30c343e50c2c34aad48e55e16ba40ca87131ee4dfaa15f7b5bf6574a9d3335e7
MD5 7965837a641a4243b6a933d551764784
BLAKE2b-256 27123717affef4c42562335f6dfc5a72f300777d92048c68e8ee69bfaa696c5c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page