JaegerSpan implements Span { @Override public JaegerSpan log(Map<String, ?> fields) { return log(tracer.clock().currentTimeMicros(), null, fields); } protected  JaegerSpan(
      JaegerTracer tracer,
      String operationName,
      JaegerSpanContext context,
      long startTimeMicroseconds,
      long startTimeNanoTicks,
      boolean computeDurationViaNanoTicks,
      Map<String, Object> tags,
      List<Reference> references); long getStart(); boolean isFinished(); long getDuration(); JaegerTracer getTracer(); List<Reference> getReferences(); Map<String, Object> getTags(); @Override JaegerSpan setOperationName(String operationName); String getOperationName(); String getServiceName(); List<LogData> getLogs(); @Override JaegerSpan setBaggageItem(String key, String value); @Override String getBaggageItem(String key); @Override String toString(); @Override JaegerSpanContext context(); @Override void finish(); @Override void finish(long finishMicros); @Override synchronized JaegerSpan setTag(String key, String value); @Override synchronized JaegerSpan setTag(String key, boolean value); @Override synchronized JaegerSpan setTag(String key, Number value); @Override synchronized Span setTag(Tag<T> tag, T value); @Override JaegerSpan log(Map<String, ?> fields); @Override JaegerSpan log(long timestampMicroseconds, Map<String, ?> fields); @Override JaegerSpan log(String event); @Override JaegerSpan log(long timestampMicroseconds, String event);  }
@Test public void testLog() { final long expectedTimestamp = 2222; final String expectedLog = "some-log"; final String expectedEvent = "expectedEvent"; when(clock.currentTimeMicros()).thenReturn(expectedTimestamp); jaegerSpan.log(expectedEvent); Map<String, String> expectedFields = Collections.singletonMap(expectedEvent, expectedLog); jaegerSpan.log(expectedFields); jaegerSpan.log((String) null); jaegerSpan.log((Map<String, ?>) null); LogData actualLogData = jaegerSpan.getLogs().get(0); assertEquals(expectedTimestamp, actualLogData.getTime()); assertEquals(expectedEvent, actualLogData.getMessage()); actualLogData = jaegerSpan.getLogs().get(1); assertEquals(expectedTimestamp, actualLogData.getTime()); assertNull(actualLogData.getMessage()); assertEquals(expectedFields, actualLogData.getFields()); }