code: def log_config(log_level: Union[str, int]) -> dict:
      
      if isinstance(log_level, int):
          # to match django
          log_level = {3: 'DEBUG', 2: 'INFO'}.get(log_level, 'WARNING')
      assert log_level in {'DEBUG', 'INFO', 'WARNING', 'ERROR'}, 'wrong log level %s' % log_level
      return {
          'version': 1,
          'disable_existing_loggers': True,
          'formatters': {
              'default': {'format': '%(message)s'},
              'indent': {'format': '    %(message)s'},
          },
          'handlers': {
              'default': {
                  'level': log_level,
                  'class': 'grablib.common.ClickHandler',
                  'formatter': 'default'
              },
              'progress': {
                  'level': log_level,
                  'class': 'grablib.common.ProgressHandler',
                  'formatter': 'indent'
              },
          },
          'loggers': {
              main_logger.name: {
                  'handlers': ['default'],
                  'level': log_level,
                  'propagate': False,
              },
              progress_logger.name: {
                  'handlers': ['progress'],
                  'level': log_level,
                  'propagate': False,
              },
          },
      }
docs: Setup default config. for dictConfig.
      :param log_level: str name or django debugging int
      :return: dict suitable for ``logging.config.dictConfig``