Hey ya’ll,
Is it at all possible to log the backtrace and error info printed to the post window in sclang? By log I mean that I am keeping a log file for a long-running SC program, and I would like to be able to write any Errors and Exceptions that occur to this log file, including the stack trace.
I know that it’s possible to overwrite the default exception handler of the sclang process like this:
thisThread.exceptionHandler = {|ex| "GOT EXCEPTION %".format(ex).warn };
And I suspect this is where I should put my file logging code. I just can’t seem to find any way of accessing the stack trace. The documentation for Exception does point to some intruiging methods like protectedBacktrace
but this does not seem to give me the stack trace when I attempt to log it.
Any thoughts?