lib/plugins/slstats/slstats.js/SlStats/toggleStats
class SlStats:  toggleStats() {
    const enableStats = this.options.enable && !this.options.disable;
    const disabledStats = this.options.disable && !this.options.enable;
    const data = { force: true };
    if (enableStats) {
      return userStats
        .track('user_enabledTracking', data)
        .then(() => {
          // set .serverlessrc config
          config.set('trackingDisabled', false);
          this.serverless.cli.log('Stats successfully enabled');
        })
        .catch(error => {
          const message = error;
          return BbPromise.reject(`Enabling / Disabling of statistics failed: ${message}`);
        });
    } else if (disabledStats) {
      return userStats
        .track('user_disabledTracking', data)
        .then(() => {
          // set .serverlessrc config
          config.set('trackingDisabled', true);
          this.serverless.cli.log('Stats successfully disabled');
        })
        .catch(error => {
          const message = error;
          return BbPromise.reject(`Enabling / Disabling of statistics failed: ${message}`);
        });
    }
    return BbPromise.resolve();
  }