sys_backtrace [function]
sys_backtrace( bool as_string = false )
returns the call stack function/line/file list, either as array of dicts, or as a string, formatted exactly like in error messages (via sgs_PushErrorInfo)
- in the dict, there are three keys:
- func (string)
- line (null/int)
- file (string)
errprint( sys_backtrace( true ) ); // print backtrace to stderr println( sys_backtrace().last.func ); // print name of current function