configure(config = {}) {
    const { container } = this;

    assert(
      'Cannot call `configure` once requests have been handled.',
      this._requests.length === 0
    );
    assert(
      'Cannot call `configure` on an instance of Polly that is not running.',
      this.mode !== MODES.STOPPED
    );

    // Disconnect from all current adapters before updating the config
    this.disconnect();

    if (this.logger) {
      this.logger.disconnect();
    }

    // Update the config
    this.config = mergeConfigs(DefaultConfig, this.config, config);

    // Create a new logger
    this.logger = new Logger(this);
    this.logger.connect();

    // Register and connect to all specified adapters
    this.config.adapters.forEach((adapter) => this.connectTo(adapter));

    /* Handle Persister */
    let { persister } = this.config;

    if (persister) {
      if (typeof persister === 'function') {
        container.register(persister);
        persister = persister.id;
      }

      assert(
        `Persister matching the name \`${persister}\` was not registered.`,
        container.has(`persister:${persister}`)
      );

      this.persister = new (container.lookup(`persister:${persister}`))(this);
    }

    this.logger.log.debug('Polly instance configured.', {
      config: this.config
    });
  }
@param {Object} [config={}]
@public
@memberof Polly