Getting Chrome console.log to display the line calling the function

Is there any way on the Chrome console tab to display the address that called the function?

I have a function that is called, but I don't know where it came from. I know that I can break down and look at the call stack, but I would rather just display on each entry that called it:

functon select_el() {
console.log("select_el called by " + ?????);

    etc.
}

thanks

0
source share
2 answers

I do not think you can do this with help console.log(). Try with console.error()if you're ok with red pin.

+1
source

The answer to this question may be what you are looking for.

, LineNumber .

0

All Articles