# Debugging

**URL:** <https://www.ruby-forum.com/t/debugging/65618>\
**Category:** Ruby\
**Created:** [February 11, 2006, 12:23am UTC](https://www.ruby-forum.com/t/debugging/65618 "2006-02-11T00:23:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaatschS\_Bernd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/fbc32d/32.png) [@PaatschS\_Bernd](https://www.ruby-forum.com/u/PaatschS_Bernd)\
**Post date:** [February 11, 2006, 12:23am UTC](https://www.ruby-forum.com/t/debugging/65618/1 "2006-02-11T00:23:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![PaatschS\_Bernd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/fbc32d/32.png) [@PaatschS\_Bernd](https://www.ruby-forum.com/u/PaatschS_Bernd)\
**Post date:** [February 11, 2006, 5:37am UTC](https://www.ruby-forum.com/t/debugging/65618/2 "2006-02-11T05:37:53Z")

</div>

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 G. II

---

<div class="post-metadata">

**Author:** ![PaatschS\_Bernd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/fbc32d/32.png) [@PaatschS\_Bernd](https://www.ruby-forum.com/u/PaatschS_Bernd)\
**Post date:** [February 12, 2006, 8:19am UTC](https://www.ruby-forum.com/t/debugging/65618/3 "2006-02-12T08:19:37Z")

</div>

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 H. - removed\_email\_address@domain.invalid - [http://segment7.net](http://segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)
