Skip to content

How do I debug YellowLabTools?

Gaël Métais edited this page Jan 7, 2021 · 1 revision

YellowLabTools has a debug mode that needs to be activated with an environment variable. It is quite verbose, but it can help!

If you're running YLT as a server:

DEBUG=ylt:* node bin/server.js

If you're running the CLI:

DEBUG=ylt:* node bin/cli.js https://www.website.com

If you're running YLT as a node package from your own code, you can still do it:

DEBUG=ylt:* node your-own-code.js

Debugging Phantomas or Puppeteer

You'll notice that the beginning of a run doesn't log anything. This is because YLT is running Phantomas and this tool has its own debugging namespace. You can debug this part simply like that:

DEBUG=phantomas:* node ...

You can even debug the underlying Puppeteer and every other tools compatible with the DEBUG environment variable:

DEBUG=* node ...

Have fun and good luck!