[BUG] debug.enable('pw:api') does not work in 1.25 (worked in 1.20)
See original GitHub issueContext:
- Playwright Version: 1.25.0
- Operating System: Mac
- Node.js version: 14.19.2
Describe the bug
This is regarding the logging that you get with DEBUG=pw:api.
I am upgrading from Playwright 1.20.1 to 1.25.0. We use Playwright with the Mocha testrunner, launched from a Node script.
The following works in Playwright 1.20.1, but does not work in Playwright 1.25.0 (no other changes):
import debug from 'debug';
debug.enable('pw:api')
Note that I get the logging if I set DEBUG=pw:api from the command line when starting up Node. It just doesn’t work when using the debug library like above.
Issue Analytics
- State:
- Created a year ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Troubleshooting common PHP debugging issues | PhpStorm ...
This section provides the list of solutions and workarounds for common problems with Debugging in PhpStorm. Collecting PhpStorm debugging logs.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks for your report! If you need logs, using the environment variable or Logger API are the correct ways of doing it.
To my knowledge:
is not documented to be supported by PW, and the fact it was working before was merely a coincidence. 😄 While convenient, the fact PW uses the
debugpackage is an implementation detail that should not be depended upon. My best guess as to why it stopped working: we started bundling Playwright’s deps within the last few months so the PW package now has zero deps (https://www.npmjs.com/package/playwright-core)!There are no plans at the moment. (When we have an idea of a release milestone, we tag with v1.XY.)
Would you be open to contributing a PR?