Add option for better debug logging
After using the extra-header option, pagedjs starts throwing an error due to Google Fonts CORS issue. I had some trouble diagnosing this problem, until I added the following code the printer.js:
page
.on('console', message =>
console.log(`${message.type().substr(0, 3).toUpperCase()} ${message.text()}`))
.on('pageerror', ({ message }) => console.log(message))
.on('requestfailed', request =>
console.log(`${request.failure().errorText} ${request.url()}`))
This prints console messages and page errors to the command line when running pagedjs-cli. It would be great if there was an option to enable this.