Skip to content

Commit a58c98e

Browse files
joyeecheungrichardlau
authored andcommitted
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: #50960 Refs: nodejs/single-executable#68 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Stephen Belanger <[email protected]>
1 parent 287a02c commit a58c98e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/blob_serializer_deserializer-inl.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,11 @@ std::string_view BlobDeserializer<Impl>::ReadStringView(StringLogMode mode) {
140140
Debug("ReadStringView(), length=%zu: ", length);
141141

142142
std::string_view result(sink.data() + read_total, length);
143-
Debug("%p, read %zu bytes\n", result.data(), result.size());
143+
Debug("%p, read %zu bytes", result.data(), result.size());
144144
if (mode == StringLogMode::kAddressAndContent) {
145-
Debug("%s", result);
145+
Debug(", content:%s%s", length > 32 ? "\n" : " ", result);
146146
}
147+
Debug("\n");
147148

148149
read_total += length;
149150
return result;

0 commit comments

Comments
 (0)