Forum: Ruby Debugging

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fd870ca69f1243766bd8697ea3415df2?d=identicon&s=25 Paatsch, Bernd (Guest)
on 2006-02-11 00:23
(Received via mailing list)
Hello,

Is it possible in ruby to generate during runtime in case of an error a
log
file containing the name of the file, the line number and the line of
the
code? If so how, or where to find information about it?

Thanks,
Bernd
4299e35bacef054df40583da2d51edea?d=identicon&s=25 James Gray (bbazzarrakk)
on 2006-02-11 05:37
(Received via mailing list)
On Feb 10, 2006, at 5:22 PM, Paatsch, Bernd wrote:

> Hello,
>
> Is it possible in ruby to generate during runtime in case of an
> error a log
> file containing the name of the file, the line number and the line
> of the
> code? If so how, or where to find information about it?

Well, you could wrap your whole code in:

begin
   # your code goes here...
rescue Exception => error
   # write out to a file here, using method of error for info...
end

James Edward Gray II
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2006-02-12 08:19
(Received via mailing list)
On Feb 10, 2006, at 3:22 PM, Paatsch, Bernd wrote:

> Hello,
>
> Is it possible in ruby to generate during runtime in case of an
> error a log
> file containing the name of the file, the line number and the line
> of the
> code? If so how, or where to find information about it?

ruby -d prints out every exception raised.

--
Eric Hodel - drbrain@segment7.net - http://segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com
This topic is locked and can not be replied to.