private JaegerSpan log(long timestampMicroseconds, String event, Map<String, ?> fields) { synchronized (this) { if (fields == null && event == null) { return this; } if (context.isSampled()) { if (fields != null && tracer.isExpandExceptionLogs()) { fields = addExceptionLogs(fields); } if (logs == null) { this.logs = new ArrayList<LogData>(); } logs.add(new LogData(timestampMicroseconds, event, fields)); } return this; } }