-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move Payload pretty-print from Display to Debug #805
Move Payload pretty-print from Display to Debug #805
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yaaaaaaay! I'm jazzed for this.
My only remaining thought is that sometimes it may be pretty important to get the full payload dumped to the log, even if it is longer than 64 bytes. I can't really think of any reasonable way to configure than other than an environment variable.
Let's add that so we at least have the option when debugging stuff or if a customer needs to show us some info. We can call it something like TEMPORAL_PRINT_FULL_PAYLOADS
and if that's set in the environment, then don't do the >64 byte truncation thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noice!
What was changed
Spencer previously implemented a pretty-print for
Display
forPayload
.Debug
was not touched because prost automatically generated theDebug
impl forPayload
. Prost and tonic-build now support skipping theDebug
impl, tokio-rs/prost#797, so we can leverage this to provide our ownDebug
impl.Also added support to skip this truncation by specifying the
TEMPORAL_PRINT_FULL_PAYLOADS
env variableWhy?
A nice-to-have feature to make debug logs more readable.
Checklist
Closes
[Feature Request] Pretty print Payload data #806
How was this tested:
Generated temporal.api.common.v1.rs now generates