Optimization to avoid serialization when logging disabled.
MODIFY
dd-trace-ot/src/main/java/datadog/trace/common/writer/LoggingWriter.java
dd-trace-ot/src/main/java/datadog/trace/common/writer/LoggingWriter.java
@@ -11,12 +11,14 @@ public class LoggingWriter implements Writer {
@Override
public void write(final List<DDSpan> trace) {
+ if (log.isInfoEnabled()) {
try {
log.info("write(trace): {}", serializer.writeValueAsString(trace));
} catch (final Exception e) {
log.error("error writing(trace): {}", trace);
}
}
+ }
@Override
public void close() {

Optimization to avoid serialization when logging disabled.