Skip to content
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

feat(common): truncation support for plain strings in the RPC log #9351

Merged
merged 1 commit into from
Jun 25, 2022

Conversation

devbww
Copy link
Contributor

@devbww devbww commented Jun 25, 2022

Add DebugString(std::string, TracingOptions const&) for adding a plain
string to the RPC log, but with the truncate_string_field_longer_than
behavior of google::protobuf::TextFormat::Printer.

This will be used in an upcoming change that will log a resume_token
from the Spanner streaming read/query protocol, and which is extremely
long.


This change is Reviewable

Add `DebugString(std::string, TracingOptions const&)` for adding a plain
string to the RPC log, but with the `truncate_string_field_longer_than`
behavior of `google::protobuf::TextFormat::Printer`.

This will be used in an upcoming change that will log a `resume_token`
from the Spanner streaming read/query protocol, and which is extremely
long.
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: 326d7d4ca159d34abf5c88fe253cdec6506a9f9c

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@codecov
Copy link

codecov bot commented Jun 25, 2022

Codecov Report

Merging #9351 (326d7d4) into main (aa85455) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #9351   +/-   ##
=======================================
  Coverage   94.65%   94.65%           
=======================================
  Files        1470     1470           
  Lines      134809   134820   +11     
=======================================
+ Hits       127601   127615   +14     
+ Misses       7208     7205    -3     
Impacted Files Coverage Δ
google/cloud/internal/log_wrapper.h 93.68% <ø> (ø)
google/cloud/internal/log_wrapper.cc 76.38% <100.00%> (+1.38%) ⬆️
google/cloud/internal/log_wrapper_test.cc 99.42% <100.00%> (+0.02%) ⬆️
...loud/bigtable/internal/connection_refresh_state.cc 97.22% <0.00%> (-2.78%) ⬇️
google/cloud/pubsub/samples/samples.cc 92.18% <0.00%> (+0.07%) ⬆️
...cloud/pubsub/internal/subscription_session_test.cc 98.25% <0.00%> (+0.24%) ⬆️
...ud/spanner/integration_tests/client_stress_test.cc 86.18% <0.00%> (+0.65%) ⬆️
...e/cloud/pubsublite/internal/alarm_registry_impl.cc 100.00% <0.00%> (+2.94%) ⬆️
google/cloud/internal/async_rpc_details.h 100.00% <0.00%> (+5.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa85455...326d7d4. Read the comment docs.

Copy link
Contributor

@coryan coryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @devbww)

@devbww devbww marked this pull request as ready for review June 25, 2022 17:38
@devbww devbww requested a review from a team as a code owner June 25, 2022 17:38
@devbww devbww merged commit d0985a5 into googleapis:main Jun 25, 2022
@devbww devbww deleted the rpc-long-unbounded-string branch June 25, 2022 17:42
devbww added a commit to devbww/google-cloud-cpp that referenced this pull request Jun 28, 2022
Add a cast to the `int64_t`-to-`size_t` conversion from googleapis#9351.
devbww added a commit that referenced this pull request Jun 28, 2022
Add a cast to the `int64_t`-to-`size_t` conversion from #9351.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants