lib/plugins/aws/invoke/index.js/AwsInvoke/log
class AwsInvoke:  log(invocationReply) {
    const color = !invocationReply.FunctionError ? x => x : chalk.red;

    if (invocationReply.Payload) {
      const response = JSON.parse(invocationReply.Payload);

      this.consoleLog(color(JSON.stringify(response, null, 4)));
    }

    if (invocationReply.LogResult) {
      this.consoleLog(
        chalk.gray('--------------------------------------------------------------------')
      );
      const logResult = Buffer.from(invocationReply.LogResult, 'base64').toString();
      logResult.split('\n').forEach(line => this.consoleLog(formatLambdaLogEvent(line)));
    }

    if (invocationReply.FunctionError) {
      return BbPromise.reject(new Error('Invoked function failed'));
    }

    return BbPromise.resolve();
  }