Ultimate Python colorized logger
Project description
rainbow_logging_handler
Ultimate Python colorized logger.
Usage
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for rainbow_logging_handler-1.0.1.zip
Algorithm | Hash digest | |
---|---|---|
SHA256 | 362b3df3dd5c8bad9f4d814cfc7d540108243a566440a3c595fbca78af0960f6 |
|
MD5 | c9f9593081f1e1ae0c09000720210942 |
|
BLAKE2b-256 | 7c3c6ac4d8f5d8e9f97902444fbd9637c17e10df7de46cd53adbff427fe9fc0c |