Lars Christensen
8/26/2008 11:02:00 AM
On Aug 26, 12:32 pm, aidy <aidy.le...@googlemail.com> wrote:
> Is it possible to log a stack trace to a text file?
Yes: Raise an exception.
def backtrace
begin
fail
rescue Exception => e
return e.backtrace[1..-1]
end
end
File.open("backtrace.txt", "w") do |f|
f.puts backtrace
end
Lars