Skip to content

Commit 33bccbd

Browse files
committed
formatting, visibilty fixes
removing redundant code
1 parent 51131e4 commit 33bccbd

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

google-cloud-logging/src/main/java/com/google/cloud/logging/MonitoredResourceUtil.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ String getKey() {
7474
}
7575
}
7676

77-
private static String appEngineLabelPrefix = "appengine.googleapis.com/";
77+
private static final String APPENGINE_LABEL_PREFIX = "appengine.googleapis.com/";
7878

7979
private static Map<String, Label[]> resourceTypeWithLabels;
8080

@@ -199,13 +199,12 @@ private static List<LoggingEnhancer> getEnhancers(Resource resourceType) {
199199
switch (resourceType) {
200200
// Trace logging enhancer is supported on GAE Flex and Standard.
201201
case GaeAppFlex:
202-
enhancers = new ArrayList<>();
203202
enhancers.add(new LabelLoggingEnhancer(
204-
appEngineLabelPrefix, Collections.singletonList(Label.InstanceName)));
205-
enhancers.add(new TraceLoggingEnhancer(appEngineLabelPrefix));
203+
APPENGINE_LABEL_PREFIX, Collections.singletonList(Label.InstanceName)));
204+
enhancers.add(new TraceLoggingEnhancer(APPENGINE_LABEL_PREFIX));
206205
break;
207206
case GaeAppStandard:
208-
enhancers.add(new TraceLoggingEnhancer(appEngineLabelPrefix));
207+
enhancers.add(new TraceLoggingEnhancer(APPENGINE_LABEL_PREFIX));
209208
break;
210209
default:
211210
enhancers = Collections.emptyList();
@@ -220,7 +219,7 @@ private static List<LoggingEnhancer> getEnhancers(Resource resourceType) {
220219
* are restricted to a supported set per resource.
221220
* @see <a href="https://cloud.google.com/logging/docs/api/v2/resource-list">Logging Labels</a>
222221
*/
223-
static class LabelLoggingEnhancer implements LoggingEnhancer {
222+
private static class LabelLoggingEnhancer implements LoggingEnhancer {
224223
String prefix;
225224
List<Label> labels;
226225

google-cloud-logging/src/main/java/com/google/cloud/logging/TraceLoggingEnhancer.java

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

22-
String prefix;
22+
private final String prefix;
23+
2324
public TraceLoggingEnhancer(String prefix) {
2425
this.prefix = (prefix != null) ? prefix : "";
2526
}

0 commit comments

Comments
 (0)