Skip to content

cmdctrlesc/dynamic-color-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

dynamic-color-logger

A logger whose colors aren't specific to its levels but rather specified dynamically like so:

my_red_personal_logger = create_personal_logger(color='red')
my_green_personal_logger = create_personal_logger(color='green')



my_red_personal_logger.info('something is happening with this feature')
my_red_personal_logger.warning('something bad is happening with this feature')
my_red_personal_logger.critical('something REALLY bad is happening with this feature')
#all of these messages will be red

my_green_personal_logger.info('something is happening with another feature')
#this message will be green

This is useful when onboarding on large and/or convoluted codebases where the call stack is not obvious from the architecture. In such cases we might want to log different variables with different colors to better keep track of the changes in state.

About

A logger whose colors are specified dynamically

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages