phantom js log console.log messages in terminal of url
var args = require('system').args;
var page = require('webpage').create();
var url = 'http://localhost:3000/central/src/index.html#';
console.log('Loading a web page');
if (args.length === 1) {
console.log('Try to pass some arguments when invoking this script!');
phantom.exit();
} else {
url = url + args[1];
page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.open(url, function(status) {
window.setTimeout(function() {
page.render("dummy");
phantom.exit();
}, 1000)
});
}