Skip to content

filwie/cologging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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

About

Distract yourself with some colors πŸ“˜πŸš—πŸ’›πŸ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages