This change adds the writing of the remote execution log to a file behind an experimental flag. It also adds a logging handler for Execute calls so that they are logged.

PiperOrigin-RevId: 190991493
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteOptions.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteOptions.java
index e6493f3..dd4f5a0 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/RemoteOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteOptions.java
@@ -206,4 +206,20 @@
             + "writing of files, which could cause false positives."
   )
   public boolean experimentalGuardAgainstConcurrentChanges;
+
+  @Option(
+    name = "experimental_remote_grpc_log",
+    defaultValue = "",
+    category = "remote",
+    documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+    effectTags = {OptionEffectTag.UNKNOWN},
+    help =
+        "If specified, a path to a file to log gRPC call related details. This log consists "
+            + "of a sequence of serialized "
+            + "com.google.devtools.build.lib.remote.logging.RemoteExecutionLog.LogEntry "
+            + "protobufs with each message prefixed by a varint denoting the size of the following "
+            + "serialized protobuf message, as performed by the method "
+            + "LogEntry.writeDelimitedTo(OutputStream)."
+  )
+  public String experimentalRemoteGrpcLog;
 }