lib/plugins/aws/logs/index.js/AwsLogs/showLogs
class AwsLogs:  showLogs(logStreamNames) {
    if (!logStreamNames || !logStreamNames.length) {
      if (this.options.tail) {
        return setTimeout((() => this.getLogStreams()
          .then(nextLogStreamNames => this.showLogs(nextLogStreamNames))),
          this.options.interval);
      }
    }

    const params = {
      logGroupName: this.options.logGroupName,
      interleaved: true,
      logStreamNames,
      startTime: this.options.startTime,
    };

    if (this.options.filter) params.filterPattern = this.options.filter;
    if (this.options.nextToken) params.nextToken = this.options.nextToken;
    if (this.options.startTime) {
      const since = (['m', 'h', 'd']
        .indexOf(this.options.startTime[this.options.startTime.length - 1]) !== -1);
      if (since) {
        params.startTime = moment().subtract(this.options
          .startTime.replace(/\D/g, ''), this.options
          .startTime.replace(/\d/g, '')).valueOf();
      } else {
        params.startTime = moment.utc(this.options.startTime).valueOf();
      }
    } else {
      params.startTime = moment().subtract(10, 'm').valueOf();
      if (this.options.tail) {
        params.startTime = moment().subtract(10, 's').valueOf();
      }
    }

    return this.provider
      .request('CloudWatchLogs',
        'filterLogEvents',
        params)
      .then(results => {
        if (results.events) {
          results.events.forEach(e => {
            process.stdout.write(formatLambdaLogEvent(e.message));
          });
        }

        if (results.nextToken) {
          this.options.nextToken = results.nextToken;
        } else {
          delete this.options.nextToken;
        }

        if (this.options.tail) {
          if (results.events && results.events.length) {
            this.options.startTime = _.last(results.events).timestamp + 1;
          }

          return setTimeout((() => this.getLogStreams()
              .then(nextLogStreamNames => this.showLogs(nextLogStreamNames))),
            this.options.interval);
        }

        return BbPromise.resolve();
      });
  }