From a58c98ea8559d604cc56fb98e6795742f1aea616 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. PR-URL: https://github.com/nodejs/node/pull/50960 Refs: https://github.com/nodejs/single-executable/issues/68 Reviewed-By: Antoine du Hamel Reviewed-By: Stephen Belanger --- 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;