def colorlogs(format="<STR_LIT>"):
try:<EOL><INDENT>from rainbow_logging_handler import RainbowLoggingHandler<EOL>import sys<EOL>logger = logging.root<EOL>if format == "<STR_LIT>":<EOL><INDENT>fmt = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>fmt = "<STR_LIT>"<EOL><DEDENT>formatter = logging.Formatter(fmt)<EOL>handler = RainbowLoggingHandler(sys.stderr,<EOL>color_funcName=('<STR_LIT>', '<STR_LIT>', True))<EOL>handler.setFormatter(formatter)<EOL>logger.addHandler(handler)<EOL><DEDENT>except ImportError:<EOL><INDENT>pass<EOL><DEDENT>
Append a rainbow logging handler and a formatter to the root logger