diff --git a/sdk-core-protos/Cargo.toml b/sdk-core-protos/Cargo.toml index 616d6935e..e8eb164d1 100644 --- a/sdk-core-protos/Cargo.toml +++ b/sdk-core-protos/Cargo.toml @@ -30,6 +30,7 @@ uuid = { version = "1.1", features = ["v4"], optional = true } [build-dependencies] tonic-build = { workspace = true } +prost-build = "0.13" prost-wkt-build = "0.6" [lints] diff --git a/sdk-core-protos/build.rs b/sdk-core-protos/build.rs index 58f7126ff..c5dca0e21 100644 --- a/sdk-core-protos/build.rs +++ b/sdk-core-protos/build.rs @@ -113,6 +113,7 @@ fn main() -> Result<(), Box> { "::prost_wkt_types::Value" ) .file_descriptor_set_path(descriptor_file) + .skip_debug("temporal.api.common.v1.Payload") .compile_protos( &[ "./protos/local/temporal/sdk/core/core_interface.proto", diff --git a/sdk-core-protos/src/lib.rs b/sdk-core-protos/src/lib.rs index 88580e526..c00aaa19d 100644 --- a/sdk-core-protos/src/lib.rs +++ b/sdk-core-protos/src/lib.rs @@ -1765,9 +1765,11 @@ pub mod temporal { } } - impl Display for Payload { + impl std::fmt::Debug for Payload { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - if self.data.len() > 64 { + if std::env::var("TEMPORAL_PRINT_FULL_PAYLOADS").is_err() + && self.data.len() > 64 + { let mut windows = self.data.as_slice().windows(32); write!( f, @@ -1781,6 +1783,12 @@ pub mod temporal { } } + impl Display for Payload { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self) + } + } + impl Display for Header { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!(f, "Header(")?;