hclogger

A hierarchical and colourful logging module


Keywords
logger, logging, print, python
License
GPL-3.0
Install
pip install hclogger==1.0.4

Documentation

Hierarchical Colored Logger Module for Python

HCLogger is a logging module using Termcolor and a hierarchical format to improve readability.

Note: this module was designed to deal with concurrency. However, it is encouraged to store thread logs into different log files.

HCLogger capture

Installation

pip install hclogger

Usage

As simple as it could be:

from HCLogger import Logger

logger = Logger(filename='fname.log', verbose=False)
logger.debug('This is a debug message.')

Output:

Debug output

The hierarchy is added to functions. In order to add hierarchy on of the following alternatives must be used:

# The manual call
logger.manual_log_func(func, args*)

# The decorated call
@logger.log_func
def func(args):
	...

func()

Output:

Function logging

Putting it all together:

Demo capture

Future work

  • Add to PyPi
  • Create web view