Because I\'m lazy, I created a function log
that basically is just an abbreviation of console.log
:
function log() {
console.log.a
When I reported it, it was refused but the answer was simple - create the shortcut like this:
var log = console.log.bind(console);
This doesn't leave out the line number, whilst you can call it like log(...)
.
I just created a module to do that.
Check out: https://github.com/ahlechandre/consl
npm install consl --save-dev
const { cl } = require('consl');
cl('Outputs a message on the Console using a quick');
In my case I've set up an AutoHotKey shortcut with Ctrl + Alt + L as below:
^!l::Send console.log();{Left}{Left}
The good thing is it brings the cursor back inside the brackets for quick typing.
Tried a few things, but I don't think you can do this. As soon as you wrap console.log
, the line nr will be the line where this wrap is to be found in the code. I suppose we have to live with that then?