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 <duhamelantoine1995@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
  • Loading branch information
joyeecheung authored and richardlau committed Mar 25, 2024
1 parent ede4eb9 commit 9959b3b
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 9959b3b

Please sign in to comment.