ad_get_tcl_call_stack (public)
ad_get_tcl_call_stack [ level ]
Defined in packages/acs-tcl/tcl/utilities-procs.tcl
Returns a stack trace from where the caller was called. See also ad_print_stack_trace which generates a more readable stack trace at the expense of truncating args.
- Parameters:
- level (optional, defaults to
"-2"
)- The level to start from, relative to this proc. The value -2 refers to the proc that called this proc's caller. Per default, don't show "ad_log", when this calls ad_get_tcl_call_stack.
- Author:
- Lars Pind <lars@pinds.com>
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set stack "" # # keep the previous state of ::errorInfo # set errorInfo $::errorInfo for { set x [expr {[info level] + $level}] } { $x > 0 } { incr x -1 } { set info [info level $x] regsub -all \n $info {\\n} info # # In case, we have an NSF frame, add information about the # current object and the current class to the debug output. # if {![catch {uplevel #$x ::nsf::current} obj] && ![catch {uplevel #$x [list ::nsf::current class]} class] } { set objInfo [list $obj $class] set info "{$objInfo} $info" } # # Don't produce too long lines # if {[string length $info]>200} { set arglist "" foreach arg $info { if {[string length $arg]>40} {set arg [string range $arg 0 40]...} lappend arglist $arg } set info $arglist } append stack " called from $info\n" } # # restore previous state of ::errorInfo # set ::errorInfo $errorInfo return $stackXQL Not present: PostgreSQL, Oracle Generic XQL file: packages/acs-tcl/tcl/utilities-procs.xql