io.opentelemetry.exporter.logging.otlp.JsonUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opentelemetry-exporter-logging-otlp Show documentation
Show all versions of opentelemetry-exporter-logging-otlp Show documentation
OpenTelemetry Protocol JSON Logging Exporters
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.exporter.logging.otlp;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.io.SegmentedStringWriter;
import java.io.IOException;
final class JsonUtil {
static final JsonFactory JSON_FACTORY = new JsonFactory();
static JsonGenerator create(SegmentedStringWriter stringWriter) {
try {
return JSON_FACTORY.createGenerator(stringWriter);
} catch (IOException e) {
throw new IllegalStateException("Unable to create in-memory JsonGenerator, can't happen.", e);
}
}
private JsonUtil() {}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy