Skip to content

causemx/richlogging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

richlogging

Enriching logging library of python.

Reqirement

  • python >= 3.4

Installation

pip3 install richlogging

Usage

  • Basic usage
from richlogging import *
_logger = Logger([logger_name])
_logger.logger.debug([message])
_logger.logger.info([message])
_logger.logger.warn([message])
_logger.logger.error([message])
_logger.logger.critical([message])
  • Output Imgur

Or you can customized color mapping by overrwriting ColorMapping class.

  • ASCI Color code table Imgur

Add class below:

class MyColorMap(ColorMapping):
    DEBUG = "\x1b[38;5;255m"
    INFO = "\x1b[38;5;252m"
    WARNING = "\x1b[38;5;248m"
    ERROR = "\x1b[38;5;244m"
    CRITICAL = "\x1b[38;5;232m"
  • Output Imgur

About

Enriching logging library of python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages