Skip to content

Commit 90b824a

Browse files
fix: Switch instrumentation code to return version stored in DEFAULT_INSTRUMENTATION_VERSION (#918)
* feat: Add support for instrumentation version annotations * fix: Switch instrumentation code to return version stored in DEFAULT_INSTRUMENTATION_VERSION * Add comment for release-please versions * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 0d843ca commit 90b824a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/main/java/com/google/cloud/logging/logback/LoggingAppender.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ public class LoggingAppender extends UnsynchronizedAppenderBase<ILoggingEvent> {
104104
private static final List<LoggingEventEnhancer> DEFAULT_LOGGING_EVENT_ENHANCERS =
105105
ImmutableList.<LoggingEventEnhancer>of(new MDCEventEnhancer());
106106
public static final String JAVA_LOGBACK_LIBRARY_NAME = "java-logback";
107-
// {x-version-update:google-cloud-logging-logback:current}
107+
// Using release-please annotations to update DEFAULT_INSTRUMENTATION_VERSION with latest version.
108+
// See
109+
// https://github.com/googleapis/release-please/blob/main/docs/customizing.md#updating-arbitrary-files
110+
// {x-version-update-start:google-cloud-logging-logback:current}
108111
public static final String DEFAULT_INSTRUMENTATION_VERSION = "1.0.0";
109112
// {x-version-update-end}
110113
private static boolean instrumentationAdded = false;
@@ -348,7 +351,7 @@ protected void append(ILoggingEvent e) {
348351
if (!setInstrumentationStatus(true)) {
349352
entriesList.add(
350353
Instrumentation.createDiagnosticEntry(
351-
JAVA_LOGBACK_LIBRARY_NAME, Instrumentation.getLibraryVersion(LoggingAppender.class)));
354+
JAVA_LOGBACK_LIBRARY_NAME, DEFAULT_INSTRUMENTATION_VERSION));
352355
}
353356
Iterable<LogEntry> entries = entriesList;
354357
if (autoPopulateMetadata) {

0 commit comments

Comments
 (0)