I am currently writing a logger that uses a console.log(). As I call to logger method instead of a console.log(), every log line shows the same position on the source code that corresponds to the linea where is the call to console.log(). I would like to include a link in the message that can show the line which is the origin of the log.
In Google Chrome it is possible to log an URL with a line number and column number (separated by colon) and it is automatically converted to a link. If I click on the link, I can view the source code at the specified line. Here is an example:
// press F12 and click on link in the console log, this will open the source code in the "Sources" tab at line-column 3:5
console.log('http://akfs.nspmotion.com/test/example.js:3:5');<script src="http://akfs.nspmotion.com/test/example.js"></script>Is there any way to achieve something like this in the Firefox console?
The feature that logged URLs including row and column information are linked to the Debugger doesn't exist yet in the Firefox DevTools. Therefore I've requested it now in bug 1360447.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With