Finding a function call source string

I created a special logging utility that displays the log message and DateTime. I would like to add a line number in the source code that called the function.

Is there a way to determine which HTML source line ran a specific javascript function?

+3
source share
1 answer

Having written the logging library ( log4javascript ), I considered the same problem, and here are my thoughts:

, Error, . Error , , . , , - stack Error ( message Opera), :

  • Mozilla, WebKit Opera.
  • - , ,
  • Error .

log4javascript , , , .

+7

Source: https://habr.com/ru/post/1746214/


All Articles