Optimization to avoid serialization when logging disabled.
@@ -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() {
