diff --git a/capture.template.js b/capture.template.js index 0ad76d4..4814672 100644 --- a/capture.template.js +++ b/capture.template.js @@ -15,6 +15,10 @@ page.settings.<%= key %> = <%= value %> <% }) %> + page.onConsoleMessage = function () { + console.log.apply(console, arguments) + } + <% if (debug) { %> function debugPage() { console.log('Launch the debugger page at http://localhost:9000/webkit/inspector/inspector.html?page=2') diff --git a/index.js b/index.js index 8d01e4d..0275a35 100644 --- a/index.js +++ b/index.js @@ -71,6 +71,14 @@ var PhantomJSBrowser = function (baseBrowserDecorator, config, args, logger) { // and start phantomjs this._execCommand(this._getCommand(), flags) + this._process.stderr.on('data', function (data) { + log.error('' + data) + }) + + this._process.stdout.on('data', function (data) { + log.debug('' + data) + }) + if (args.debug) { log.info('ACTION REQUIRED:') log.info('')