Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public final class GrpcPlainRequestLoggingInterceptor implements ClientIntercept

private static final Metadata.Key<String> X_GOOG_REQUEST_PARAMS =
Metadata.Key.of("x-goog-request-params", Metadata.ASCII_STRING_MARSHALLER);
private static final Metadata.Key<String> X_RETRY_TEST_ID =
Metadata.Key.of("x-retry-test-id", Metadata.ASCII_STRING_MARSHALLER);

/**
* Define a map of message types we want to try to unpack from an {@link Any}.
Expand Down Expand Up @@ -116,7 +118,7 @@ public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall(
return new SimpleForwardingClientCall<ReqT, RespT>(call) {
@Override
public void start(Listener<RespT> responseListener, Metadata headers) {
if (headers.containsKey(X_GOOG_REQUEST_PARAMS)) {
if (headers.containsKey(X_GOOG_REQUEST_PARAMS) || headers.containsKey(X_RETRY_TEST_ID)) {
LOGGER.atDebug().log(() -> String.format(">>> headers = %s", headers));
}
SimpleForwardingClientCallListener<RespT> listener =
Expand Down Expand Up @@ -187,10 +189,10 @@ static String fmtProto(@NonNull WriteObjectRequest msg) {
ByteString trim = snipBytes(content);
b.getChecksummedDataBuilder().setContent(trim);

return b.build().toString();
return fmtProto((MessageOrBuilder) b.build());
}
}
return msg.toString();
return fmtProto((MessageOrBuilder) msg);
}

@NonNull
Expand All @@ -202,10 +204,10 @@ static String fmtProto(@NonNull BidiWriteObjectRequest msg) {
ByteString trim = snipBytes(content);
b.getChecksummedDataBuilder().setContent(trim);

return b.build().toString();
return fmtProto((MessageOrBuilder) b.build());
}
}
return msg.toString();
return fmtProto((MessageOrBuilder) msg);
}

@NonNull
Expand All @@ -217,7 +219,7 @@ static String fmtProto(@NonNull ReadObjectResponse msg) {
ByteString trim = snipBytes(content);
b.getChecksummedDataBuilder().setContent(trim);

return b.build().toString();
return fmtProto((MessageOrBuilder) b.build());
}
}
return msg.toString();
Expand All @@ -243,9 +245,9 @@ public static String fmtProto(@NonNull BidiReadObjectResponse msg) {
}
BidiReadObjectResponse snipped =
msg.toBuilder().clearObjectDataRanges().addAllObjectDataRanges(snips).build();
return snipped.toString();
return fmtProto((MessageOrBuilder) snipped);
}
return msg.toString();
return fmtProto((MessageOrBuilder) msg);
}

private static ByteString snipBytes(ByteString content) {
Expand Down