File tree Expand file tree Collapse file tree
gax-java/gax/src/main/java/com/google/api/gax Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -281,13 +281,11 @@ public static ClientContext create(StubSettings settings) throws IOException {
281281 if (apiTracerFactory instanceof SpanTracerFactory ) {
282282 apiTracerFactory = apiTracerFactory .withContext (apiTracerContext );
283283 }
284- if (com .google .api .gax .logging .LoggingUtils .isLoggingEnabled ()) {
285- com .google .api .gax .tracing .ApiTracerFactory loggingTracerFactory =
286- new com .google .api .gax .tracing .LoggingTracerFactory ().withContext (apiTracerContext );
287- apiTracerFactory =
288- new com .google .api .gax .tracing .CompositeTracerFactory (
289- apiTracerFactory , loggingTracerFactory );
290- }
284+ com .google .api .gax .tracing .ApiTracerFactory loggingTracerFactory =
285+ new com .google .api .gax .tracing .LoggingTracerFactory ().withContext (apiTracerContext );
286+ apiTracerFactory =
287+ new com .google .api .gax .tracing .CompositeTracerFactory (
288+ apiTracerFactory , loggingTracerFactory );
291289
292290 return newBuilder ()
293291 .setBackgroundResources (backgroundResources .build ())
Original file line number Diff line number Diff line change @@ -52,7 +52,8 @@ public Scope inScope() {
5252 scopes [i ] = tracers .get (i ).inScope ();
5353 }
5454 return () -> {
55- for (Scope scope : scopes ) {
55+ for (int i = scopes .length - 1 ; i >= 0 ; i --) {
56+ Scope scope = scopes [i ];
5657 if (scope != null ) {
5758 scope .close ();
5859 }
@@ -62,22 +63,22 @@ public Scope inScope() {
6263
6364 @ Override
6465 public void operationSucceeded () {
65- for (ApiTracer tracer : tracers ) {
66- tracer .operationSucceeded ();
66+ for (int i = tracers . size () - 1 ; i >= 0 ; i -- ) {
67+ tracers . get ( i ) .operationSucceeded ();
6768 }
6869 }
6970
7071 @ Override
7172 public void operationCancelled () {
72- for (ApiTracer tracer : tracers ) {
73- tracer .operationCancelled ();
73+ for (int i = tracers . size () - 1 ; i >= 0 ; i -- ) {
74+ tracers . get ( i ) .operationCancelled ();
7475 }
7576 }
7677
7778 @ Override
7879 public void operationFailed (Throwable error ) {
79- for (ApiTracer tracer : tracers ) {
80- tracer .operationFailed (error );
80+ for (int i = tracers . size () - 1 ; i >= 0 ; i -- ) {
81+ tracers . get ( i ) .operationFailed (error );
8182 }
8283 }
8384
You can’t perform that action at this time.
0 commit comments