Skip to content

Commit fd40342

Browse files
jabubakegarrettjonesgoogle
authored andcommitted
---
yaml --- r: 8067 b: refs/heads/tswast-patch-1 c: 43203a7 h: refs/heads/master i: 8065: 4ebea33 8063: 6d4ad77
1 parent c130ead commit fd40342

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ refs/tags/v0.18.0: 9d193c4c4b9d1c6f21515dd8e50836b9194ec9bb
5757
refs/tags/v0.19.0: e67b56e4d8dad5f9a7b38c9b2107c23c828f2ed5
5858
refs/tags/v0.20.0: 839f7fb7156535146aa1cb2c5aadd8d375d854e8
5959
refs/tags/v0.20.1: 370471f437f1f4f68a11e068df5cd6bf39edb1fa
60-
refs/heads/tswast-patch-1: 5d502490a9e9677c105441941f1d471bdde8a916
60+
refs/heads/tswast-patch-1: 43203a7712075d31424202c0115b0a036920e316
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b

branches/tswast-patch-1/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public LoggingHandler(
206206

207207
this.enhancers.addAll(enhancersParam);
208208

209-
List<LoggingEnhancer> loggingEnhancers = MonitoredResourceUtil.createResourceEnhancers();
209+
List<LoggingEnhancer> loggingEnhancers = MonitoredResourceUtil.getResourceEnhancers();
210210
if (loggingEnhancers != null) {
211211
this.enhancers.addAll(loggingEnhancers);
212212
}

branches/tswast-patch-1/google-cloud-logging/src/main/java/com/google/cloud/logging/MonitoredResourceUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ public static MonitoredResource getResource(String projectId, String resourceTyp
128128
/**
129129
* Returns custom log entry enhancers (if available) for resource type.
130130
*
131-
* @return custom long entry enhancers
131+
* @return custom log entry enhancers
132132
*/
133-
public static List<LoggingEnhancer> createResourceEnhancers() {
133+
public static List<LoggingEnhancer> getResourceEnhancers() {
134134
Resource resourceType = getAutoDetectedResourceType();
135135
return createEnhancers(resourceType);
136136
}

branches/tswast-patch-1/google-cloud-logging/src/main/java/com/google/cloud/logging/TraceLoggingEnhancer.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,15 @@
1919
/* Adds tracing support for logging with thread-local trace ID tracking. */
2020
public class TraceLoggingEnhancer implements LoggingEnhancer {
2121

22+
private final static String TRACE_ID = "trace_id";
2223
private final String traceIdLabel;
2324

25+
public TraceLoggingEnhancer() {
26+
traceIdLabel = TRACE_ID;
27+
}
28+
2429
public TraceLoggingEnhancer(String prefix) {
25-
this.traceIdLabel = (prefix != null) ? prefix + "trace_id" : "";
30+
traceIdLabel = (prefix != null) ? prefix + TRACE_ID : TRACE_ID;
2631
}
2732

2833
private static final ThreadLocal<String> traceId = new ThreadLocal<>();

0 commit comments

Comments
 (0)