From 500ff245be54c05023abad3c733044aece038b6b Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Mon, 20 Nov 2023 20:22:44 +0100 Subject: [PATCH] src: print string content better in BlobDeserializer When it's a short string, print it inline, otherwise print it from a separate line. Also add the missing line breaks finally. --- src/blob_serializer_deserializer-inl.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/blob_serializer_deserializer-inl.h b/src/blob_serializer_deserializer-inl.h index 354d9267cf1f41..1d1204a96e6101 100644 --- a/src/blob_serializer_deserializer-inl.h +++ b/src/blob_serializer_deserializer-inl.h @@ -140,10 +140,11 @@ std::string_view BlobDeserializer::ReadStringView(StringLogMode mode) { Debug("ReadStringView(), length=%zu: ", length); std::string_view result(sink.data() + read_total, length); - Debug("%p, read %zu bytes\n", result.data(), result.size()); + Debug("%p, read %zu bytes", result.data(), result.size()); if (mode == StringLogMode::kAddressAndContent) { - Debug("%s", result); + Debug(", content:%s%s", length > 32 ? "\n" : " ", result); } + Debug("\n"); read_total += length; return result;