Skip to main content

Ultimate Python colorized logger

Project description

rainbow_logging_handler

https://travis-ci.org/laysakura/rainbow_logging_handler.png?branch=master

Ultimate Python colorized logger.

Usage

http://github.com/laysakura/rainbow_logging_handler/raw/master/doc/screenshot.png

This script runs like above screenshot.

import sys
import logging
from rainbow_logging_handler import RainbowLoggingHandler

if __name__ == '__main__':
    root_logger = logging.getLogger()
    root_logger.setLevel(logging.DEBUG)

    handler = RainbowLoggingHandler(sys.stderr)
    formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
    handler.setFormatter(formatter)
    root_logger.addHandler(handler)
    logger = logging.getLogger('test')

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

    try:
        raise RuntimeError("Opa!")
    except Exception as e:
        logger.exception(e)

Install

Install from PyPI

$ pip install nextversion

Install from Github repo

$ git clone https://github.com/laysakura/rainbow_logging_handler.git
$ cd rainbow_logging_handler
$ ./setup.py install

Author

Mikko Ohtamaa <mikko@opensourcehacker.com>, Sho Nakatani <lay.sakura@gmail.com>

License

This is free and unencumbered public domain software. For more information, see <http://unlicense.org/> or the accompanying UNLICENSE file.

Project details


Download files

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

Source Distribution

rainbow_logging_handler-1.0.0.zip (8.9 kB view details)

Uploaded Source

File details

Details for the file rainbow_logging_handler-1.0.0.zip.

File metadata

File hashes

Hashes for rainbow_logging_handler-1.0.0.zip
Algorithm Hash digest
SHA256 f7fc07aa113b2485dfa168b191093c228c68a115fea33d1a2151d1c5d2ad8ae9
MD5 4246df269ebebdd5960f0277ff98c3e5
BLAKE2b-256 cbff19bc4790a991355c8937abdc470286697dc9764d79d23cc5d1bf926cefb6

See more details on using hashes here.

Supported by

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