debug exposes a function; simply pass this function the name of your module, and it will return a decorated version of console.error for you to pass debug statements ...
If you're considering PuppeteerSharp for PDF generation, here's the version of the story that doesn't show up in the "getting started" docs.