docs: prevent truncating of long messages with DEBUG_MAX_STRING_LENGTH=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.
This commit is contained in:
Zeke Lu 2023-01-26 14:39:22 +08:00 committed by GitHub
parent 7752532285
commit 0b717000ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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'
```