Logs a stacktrace starting from the previous call and working down.
@param {(number|string)=} depth How many frames deep to trace.
@return {Object.<string, *>} Stack trace information.
767453
function computeStackTraceOfCaller(depth) {
        depth = (depth == null ? 0 : +depth) + 1; // "+ 1" because "ofCaller" should drop one frame
        try {
            throw new Error();
        } catch (ex) {
            return computeStackTrace(ex, depth + 1);
        }
    }
645900
function getStackTraceArray() {
  var origStackTraceLimit = Error.stackTraceLimit
  var origPrepareStackTrace = Error.prepareStackTrace

  // Collect all stack frames.
  Error.stackTraceLimit = Infinity

  // Get a structured stack trace as an `Array` of `CallSite` objects, each of which represents a stack frame, with frames for native Node functions and this file removed.
  Error.prepareStackTrace = function (error, structuredStackTrace) {
    return structuredStackTrace.filter(function (frame) {
      var filePath = frame.getFileName()

      // Skip frames from within this module (i.e., `dantil`).
      if (filePath === __filename) {
        return false
      }

      // Skip frames for native Node functions (e.g., `require()`).
      if (!/\//.test(filePath)) {
        return false
      }

      return true
    })
  }

  // Collect the stack trace.
  var stack = Error().stack

  // Restore stack trace configuration after collecting stack trace.
  Error.stackTraceLimit = origStackTraceLimit
  Error.prepareStackTrace = origPrepareStackTrace

  return stack
}
197002
function makeWrappedCallback(callback, frameLocation) {
        // add a fake stack frame. we can't get a real one since we aren't inside the original function
        var traceError = new Error();
        traceError.__location = frameLocation;
        traceError.__previous = currentTraceError;
        return function() {
            // if (currentTraceError) {
            //     FIXME: This shouldn't normally happen, but it often does. Do we actually need a stack instead?
            //     console.warn("(long-stack-traces) Internal Error: currentTrace already set.");
            // }
            // restore the trace
            currentTraceError = traceError;
            try {
                return callback.apply(this, arguments);
            } catch (e) {
                console.error("Uncaught " + e.stack);
                if (LST.rethrow)
                    throw ""; // TODO: throw the original error, or undefined?
            } finally {
                // clear the trace so we can check that none is set above.
                // TODO: could we remove this for slightly better performace?
                currentTraceError = null;
            }
        }
    }
899505
public static void printStackTrace(StackTraceElement[] trace, java.io.PrintWriter out) {
        Strand.printStackTrace(trace, out);
    }
1096943
def backtrace(exc, level_meth = :error)
      return unless show_backtraces
      send(level_meth, "#{exc.class.class_name}: #{exc.message}")
      send(level_meth, "Stack trace:" +
        exc.backtrace[0..5].map {|x| "\n\t#{x}" }.join + "\n")
    end
1135930
function trace(a, b) {
    return trim((new Error()).stack.split('\n').slice(a || 3, b || 4).join('\n'));
}
1015111
def show_stack_depth(self, record, frame):
        
        logger = self

        depths = [-1]
        msg = record.getMessage()

        # For each logger in the hierarchy
        while logger:
            to_match = getattr(logger, "show_stack_regexes", ())
            for regex, depth, once, min_level in to_match:
                if record.levelno < min_level:
                    continue
                if not regex.match(record.msg):
                    continue
                # Only for a given regex, line number and logger
                unique = regex, self.frame_unique(frame), record.name
                if once:
                    if unique in logger.shown_stack_frames:
                        # We've shown this one already.
                        continue
                    # Prevent this stack frame from being shown again
                    logger.shown_stack_frames.add(unique)
                depths.append(depth)
            logger = logger.parent
        return max(depths)
904293
public static String printStackTraceElement(StackTraceElement stackTraceElement) {
        final String toString;
        if (stackTraceElement == null) {
            toString = "at null";
        }
        // Look for our eyecatcher representing a truncation
        else if (TRIMMED_STACK_TRACE_ELEMENT.equals(stackTraceElement)) {
            // Use only the class name, which is actually [internal classes]
            toString = "at " + stackTraceElement.getClassName();
            // Look for our eyecatcher representing a the stripping of redundant cause frames
        } else if (DUPLICATE_FRAMES_EYECATCHER.equals(stackTraceElement.getMethodName())) {
            // Use only the class name, which will include the ... - we don't want a "at " in this case
            toString = stackTraceElement.getClassName();
        } else {
            // The 'at' is a non-internationalised string in what we're trying to imitate   
            toString = "at " + stackTraceElement.toString();
        }
        return toString;
    }
630374
static String stackTraceToString(Throwable th) {
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        for (int depth = 0; depth < 10 && th != null; depth++) {
            th.printStackTrace(pw);
            Throwable cause = th.getCause();
            if (cause != th) {
                th = cause;
                pw.append("-------- chained exception -------").append(nl);
            }
        }
        return sw.toString();
    }
915415
private String filterStackTrace(String trace) {
    for (StackTraceFilter filter : stackFilters) {
      trace = filter.apply(trace);
    }
    return trace;
  }
518288
function (callback) {
            return this.walk_down(function (depth, node, output, depth_first) {
                if (!depth_first) {
                    for (var n = 0; n < depth; n++)
                        output += "    ";
                    output += "\"" + node.name() + "\"";
                    if (typeof callback === "function")
                        output += ": " + callback(node);
                    output += "\n";
                }
                return output;
            }, "");
        }
126017
function(expression, depth){
      var t = this;

      // Determine a default depth
      depth = typeof depth === 'undefined' ? DEFAULT_DEPTH : depth;

      // Get the raw value
      var value = t._evaluate(expression);

      // Return the depth limited results
      return Monitor.deepCopy(value, depth);
    }
1278071
function prepareStackTrace (_, stack){
    return $.map(stack.slice(2), function(frame) {
      var _f = {
        fileName: frame.getFileName(),
        linenumber: frame.getLineNumber(),
        columnNumber: frame.getColumnNumber()
      };

      if (frame.getFunctionName()) _f.functionName = frame.getFunctionName();
      if (frame.getMethodName()) _f.methodName = frame.getMethodName();
      if (frame.getThis()) _f.self = frame.getThis();

      return _f;
    });
  }
58914
def log_stack(logger, level=logging.INFO, limit=None, frame=None):
    
    if showing_stack.inside:
        return
    showing_stack.inside = True
    try:
        if frame is None:
            frame = sys._getframe(1)
        stack = "".join(traceback.format_stack(frame, limit))
        for line in (l[2:] for l in stack.split("\n") if l.strip()):
            logger.log(level, line)
    finally:
        showing_stack.inside = False
234628
public static void printStackTrace(StackTraceElement[] trace, java.io.PrintStream out) {
        Strand.printStackTrace(trace, out);
    }
340259
protected function trace()
    {
        foreach (\array_reverse($this->backtrace) as $stackFrame) {
            if ($this->isDebugCall($stackFrame)) {
                return $stackFrame;
            }
        }

        return \end($this->backtrace);
    }
1090515
function(message, level) {
            level = level || Base.LOGLEVEL.INFO;

            if (message instanceof Error) {
                message = message.toString() + (message.stack || "");
            }

            if (Base.logger.length) {
                for (var i = 0; i < Base.logger.length; i++) {
                    Base.logger[i].log(message, level);
                }
            } else if (typeof console !== "undefined") {
                var method = (console[level] || console.log);
                if(method){
                    try {
                        method.call(console, "[ " + (new Date()) + " ]: ", message);
                    } catch (e) {
                        // nothing to do here
                    }
                }
            }
        }