Skip to content

Commit

Permalink
docs: prevent truncating of long messages with DEBUG_MAX_STRING_LENGT…
Browse files Browse the repository at this point in the history
…H=null (#9587)

<!-- Thanks for submitting a pull request! Please provide enough
information so that others can review your pull request. -->

**What kind of change does this PR introduce?**

It changes the docs.

**Did you add tests for your changes?**

No.

**If relevant, did you update the documentation?**

Yes.

**Summary**

When logging the DevTools protocol traffic, the default value of
`maxStringLength` is 10000. Messages longer than that will be truncated.
This change adds an example to show how to remove the limitation with
`DEBUG_MAX_STRING_LENGTH=null`.

See https://nodejs.org/api/util.html#util_util_inspect_object_options.

**Does this PR introduce a breaking change?**

No.

**Other information**

None.
  • Loading branch information
ZekeLu committed Jan 26, 2023
1 parent 7752532 commit 0b71700
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/guides/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ variable before running your script. This will log internal traffic via
# Basic verbose logging
env DEBUG="puppeteer:*" node script.js

# Prevent truncating of long messages
env DEBUG="puppeteer:*" env DEBUG_MAX_STRING_LENGTH=null node script.js

# Protocol traffic can be rather noisy. This example filters out all Network domain messages
env DEBUG="puppeteer:*" env DEBUG_COLORS=true node script.js 2>&1 | grep -v '"Network'
```

0 comments on commit 0b71700

Please sign in to comment.