code: def colorlogs(format="short"):
      
      try:
          from rainbow_logging_handler import RainbowLoggingHandler
          import sys
          # setup `RainbowLoggingHandler`
          logger = logging.root
          # same as default
          if format == "short":
              fmt = "%(message)s "
          else:
              fmt = "[%(asctime)s] %(name)s %(funcName)s():%(lineno)d\t%(message)s [%(levelname)s]"
          formatter = logging.Formatter(fmt)
          handler = RainbowLoggingHandler(sys.stderr,
                                          color_funcName=('black', 'gray', True))
          handler.setFormatter(formatter)
          logger.addHandler(handler)
      except ImportError:
          # rainbow logger not found, that's ok
          pass
docs: Append a rainbow logging handler and a formatter to the root logger