Repository: open-telemetry/opentelemetry-java
File: api/all/src/main/java/io/opentelemetry/api/logs/LogRecordBuilder.java (Java)

Code before:
  /** Sets a string attribute. */
  default LogRecordBuilder setAttribute(String key, String value) {
    return setAttribute(stringKey(key), value);
  }

  /** Sets a Long attribute. */
  default LogRecordBuilder setAttribute(String key, Long value) {
    return setAttribute(longKey(key), value);
  }

  /** Sets a Double attribute. */
  default LogRecordBuilder setAttribute(String key, Double value) {
    return setAttribute(doubleKey(key), value);
  }

  /** Sets a Boolean attribute. */
  default LogRecordBuilder setAttribute(String key, Boolean value) {
    return setAttribute(booleanKey(key), value);
  }

  /** Sets an Integer attribute. */
  default LogRecordBuilder setAttribute(String key, Integer value) {
    return setAttribute(key, value.longValue());
  }

  /** Sets a string array attribute. */
  default LogRecordBuilder setAttribute(String key, List<String> value) {
    return setAttribute(stringArrayKey(key), value);
  }

  /** Emit the log record. */
  void emit();
}


Review comment (suggestion):
Interestingly, neither `SpanBuilder` nor `Span` have explicit setters for the array values... 

Not sure why that would be.. I will say that if we want to do this, we should add support for all the primitive array types. I.e. `List<Long>`, `List<Double>`, `List<Boolean>`.

Code after:
   * @param value the value for this attribute.
   * @return this.
   */
  <T> LogRecordBuilder setAttribute(AttributeKey<T> key, T value);

  /**
   * Sets a String attribute on the {@code LogRecord}. If the {@code LogRecord} previously contained
   * a mapping for the key, the old value is replaced by the specified value.
   *
   * <p>Note: It is strongly recommended to use {@link #setAttribute(AttributeKey, Object)}, and
   * pre-allocate your keys, if possible.
   *
   * @param key the key for this attribute.
   * @param value the value for this attribute.
   * @return this.
   */
  default LogRecordBuilder setAttribute(String key, String value) {
    return setAttribute(stringKey(key), value);
  }

  /**
   * Sets a Long attribute on the {@code LogRecord}. If the {@code LogRecord} previously contained a
   * mapping for the key, the old value is replaced by the specified value.
   *
   * <p>Note: It is strongly recommended to use {@link #setAttribute(AttributeKey, Object)}, and
   * pre-allocate your keys, if possible.
   *
   * @param key the key for this attribute.
   * @param value the value for this attribute.
   * @return this.
   */
  default LogRecordBuilder setAttribute(String key, long value) {
    return setAttribute(longKey(key), value);
  }

  /**
   * Sets a Double attribute on the {@code LogRecord}. If the {@code LogRecord} previously contained
   * a mapping for the key, the old value is replaced by the specified value.
   *
   * <p>Note: It is strongly recommended to use {@link #setAttribute(AttributeKey, Object)}, and
   * pre-allocate your keys, if possible.
   *
   * @param key the key for this attribute.
   * @param value the value for this attribute.
   * @return this.
   */
  default LogRecordBuilder setAttribute(String key, double value) {
    return setAttribute(doubleKey(key), value);
  }

  /**