def set_color_formatter(logger=None, **kw):
 if (logger is None):
  logger = logging.getLogger()
  if (not logger.handlers):
   logging.basicConfig()
 format_msg = logger.handlers[0].formatter._fmt
 fmt = ColorFormatter(format_msg, **kw)
 fmt.colorfilters.append(xxx_cyan)
 logger.handlers[0].setFormatter(fmt)

def set_color_formatter ( logger = None , ** kw ) : if ( logger is None ) : logger = logging . getLogger ( ) if ( not logger . handlers ) : logging . basicConfig ( ) format_msg = logger . handlers [ 0 ] . formatter . _fmt fmt = ColorFormatter ( format_msg , ** kw ) fmt . colorfilters . append ( xxx_cyan ) logger . handlers [ 0 ] . setFormatter ( fmt )
install a color formatter on the logger .