Fix log output corrupting markdown

Use `console.error` rather than `console.log` so logs go to stderr