How do I capture the line number of logs when capturing the console? (Chrome only - other browsers not relevant for me)
I have the below to capture all logs;
consoleLogs: [],
init: function(){
app.captureConsole();
},
captureConsole: function(){
var _log = console.log;
console.log = function() {
app.consoleLogs.push(JSON.stringify({method: 'log', args: arguments}));
return _log.apply(console, arguments); // <-- line number 123 [e.g.]
};
},
When the console is returned the line number for all consoles is 123 as expected - this isn't important. What I want is to be able to push the original console log number to my array.
It is a nw.js app so a chrome api / nw api would be great [if it exists]