Skip to content

Commit

Permalink
src: print string content better in BlobDeserializer
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
joyeecheung authored and richardlau committed Mar 25, 2024
1 parent 287a02c commit a58c98e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/blob_serializer_deserializer-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,11 @@ std::string_view BlobDeserializer<Impl>::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;
Expand Down

0 comments on commit a58c98e

Please sign in to comment.