Martin Lopez wrote:
> *I want to know how can I write in a log file.*
> **  
> *I need save some exceptions or errors and checks to see them after.*

There are a few ways.

The simplest is to open a file and write to it like this:

logfile = open("filename", "a")
logfile.puts "This message will go to the log file."
# ...
logfile.close

Or if you want to use something a bit more advanced, use Logger, that's
part of the standard library. The main advantage, I think, is it makes
it easy to separate error messages from warnings from debugging info,
and it can also rotate logs.

http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc/index.html

Cheers,
Dave
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to