docs: def setup_logger(logger, logfile):  # noqa
      # type: (logger, str) -> None
      """Set up logger"""
      global _REGISTERED_LOGGER_HANDLERS
      logger.setLevel(logging.DEBUG)
      if is_none_or_empty(logfile):
          handler = logging.StreamHandler()
      else:
          handler = logging.FileHandler(logfile, encoding='utf-8')
      logging.getLogger().addHandler(handler)
      formatter = logging.Formatter('%(asctime)s %(levelname)s - %(message)s')
      formatter.default_msec_format = '%s.%03d'
      handler.setFormatter(formatter)
      logger.addHandler(handler)
      logger.propagate = False
      _REGISTERED_LOGGER_HANDLERS.append(handler)