installDebugStream(config) {
    if (this._debugStream) {
      _.remove(this._bunyan['streams'], this._debugStream);
      // @ts-ignore
      this._debugStream.stream.end();
      this._debugStream = null;
    }

    const streamOptions = { out: null, ...config.options };
    /* istanbul ignore next */
    if (!streamOptions.out) {
      // This is a default if-else branch, used everywhere except for the unit tests.
      streamOptions.out = new PassThrough().pipe(process.stderr);
    }

    this._bunyan.addStream({
      type: 'raw',
      level: config.level,
      stream: bds.default(streamOptions),
    });

    this._debugStream = _.last(this._bunyan['streams']);

    return this;
  }
@param {Detox.DetoxLoggerConfig} config
@returns {this}