/**
   * Records the passed in data.
   *
   * @param data the base object to record
   */
  public void log(Base data, Map<String, String> tags) {
    if (data instanceof Data) {
      Envelope envelope = EnvelopeFactory.getInstance().createEnvelope((Data<Domain>) data);

      // log to queue
      String serializedEnvelope = serializeEnvelope(envelope);
      queue.enqueue(serializedEnvelope);
      InternalLogging.info(TAG, "enqueued telemetry", envelope.getName());
    } else {
      InternalLogging.warn(TAG, "telemetry not enqueued, must be of type ITelemetry");
    }
  }
  protected void processException(Data<Domain> data) {
    Envelope envelope = EnvelopeFactory.getInstance().createEnvelope(data);

    queue.isCrashing = true;
    queue.flush();

    String serializedEnvelope = serializeEnvelope(envelope);
    String[] serializedEvelopeArray = new String[] {serializedEnvelope};

    if (this.persistence != null) {
      InternalLogging.info(TAG, "persisting crash", envelope.toString());
      this.persistence.persist(serializedEvelopeArray, true);
    } else {
      InternalLogging.info(TAG, "error persisting crash", envelope.toString());
    }
  }