title: Get name and line of calling function in node.js
body: <p>How can one get the name and line of a function that called the current one? I would like to have a rudimentary debugging function like this (with <a href="https://github.com/isaacs/npmlog" rel="noreferrer">npmlog</a> defining <code>log.debug</code>):</p>
  
  <pre><code>function debug() {
    var callee, line;
    /* MAGIC */
    log.debug(callee + ":" + line, arguments)
  }
  </code></pre>
  
  <p>When called from another function it would be something like this:</p>
  
  <pre><code>function hello() {
     debug("world!")
  }
  // outputs something like:
  // "hello:2 'world!'"
  </code></pre>
  
  <p>For clarity, what I want is essentially analogous to <a href="https://stackoverflow.com/questions/2654113">this in Python</a>:</p>
  
  <pre><code>import inspect
  def caller():
      return inspect.stack()[2][3]
  // line no from getframeinfo().lineno
  </code></pre>
  
  <p>Is there a Node equivalent to accomplish this?</p>