LogAttribute extends Pair<String, T> implements JsonWriteable, Marker { public LogAttribute(final String first, final T second) { super(first, second); } LogAttribute(final String first, final T second); String getName(); static LogAttribute<T> of(final String val, final T obj); static LogAttribute<CharSequence> traceId(final CharSequence id); static LogAttribute<StackSamples> profileSamples(final StackSamples ss); static LogAttribute<Level> origLevel(final Level level); static LogAttribute<Level> origLoggerName(final String loggerName); static LogAttribute<Level> origTimeStamp(final Instant instant); static LogAttribute<Level> origTimeStamp(final long millisSinceEpoch); static LogAttribute<Slf4jLogRecord> log(final Slf4jLogRecord record); static LogAttribute<Long> execTimeMicros(final long time, final TimeUnit tu); static LogAttribute<Long> value(final String what, final long value); @Override String toString(); @Override void writeJsonTo(final Appendable appendable); void writeJsonTo(final JsonGenerator gen); static LogAttribute<Object> fromJson(final CharSequence jsonStr); static LogAttribute<Object> fromMap(final Map<String, Object> val); @Override void add(final Marker reference); @Override boolean remove(final Marker reference); @Override boolean hasChildren(); @Override boolean hasReferences(); @Override Iterator<Marker> iterator(); @Override boolean contains(final Marker other); @Override boolean contains(final String name); static final String ID_ATTR_NAME; static final String PROFILE_SAMPLES_ATTR_NAME; }
@Test public void testLogAttribute() { LogAttribute<LogAttribute<String>> test = LogAttribute.of("text", LogAttribute.of("nested", "nextsed val")); StringBuilder json = new StringBuilder(); test.writeJsonTo(json); LOG.debug("Json", json); LogAttribute<Object> fromJson = LogAttribute.fromJson(json); Assert.assertEquals(json.toString(), fromJson.toString()); }