I would like to create an error log for a application I have made. Here
is my basic error log creator.
My question: How do I get each part of the array on a new line?
File::open( "Tal Creator Log" + ".txt", "w" ) do |txt|
txt << "Finished Appending, the new files and a log is located in
P:\\project\\"
txt << "________________ ISSUES __________________"
DNErep.reduce { |x| puts txt << x }
DNEtemp.reduce { |y| puts txt << y }
end
I looked on google and SO and didn't find anything about the new line.
I appreciate all time spent and look forward to your answers.
You might want to look at puts. Or maybe one of the logging libraries that
solve logging for you (more or less)
···
On Mon, Apr 30, 2012 at 1:31 PM, Christopher D. <lists@ruby-forum.com>wrote:
I would like to create an error log for a application I have made. Here
is my basic error log creator.
My question: How do I get each part of the array on a new line?
File::open( "Tal Creator Log" + ".txt", "w" ) do |txt|
txt << "Finished Appending, the new files and a log is located in
P:\\project\\"
txt << "________________ ISSUES __________________"
DNErep.reduce { |x| puts txt << x }
DNEtemp.reduce { |y| puts txt << y }
end
I looked on google and SO and didn't find anything about the new line.
I appreciate all time spent and look forward to your answers.
You might want to look at puts. Or maybe one of the logging libraries
that
solve logging for you (more or less)
Hi pat, thanks for getting back to me
The logger isn't exactly what I'm looking for here... just a simple way
to list a few things in my array in a text file line by line instead of
consecutively..
I also tried
txt << puts line
txt << "#{puts ""}"
txt << "#{puts line}"
pat eyler wrote in post #1058996:
> You might want to look at puts. Or maybe one of the logging libraries
> that
> solve logging for you (more or less)
Hi pat, thanks for getting back to me
The logger isn't exactly what I'm looking for here... just a simple way
to list a few things in my array in a text file line by line instead of
consecutively..
I also tried
txt << puts line
txt << "#{puts ""}"
txt << "#{puts line}"
puts is a method try calling it on your filehandle instead of a default
value. (It returns nil, so the three things you tried above won't do what
you want.)
You probably also learned something else about puts from what those
attempts did.
···
On Mon, Apr 30, 2012 at 1:59 PM, Christopher D. <lists@ruby-forum.com>wrote:
You might want to look at puts. Or maybe one of the logging libraries
that
solve logging for you (more or less)
Hi pat, thanks for getting back to me
The logger isn't exactly what I'm looking for here... just a simple way
to list a few things in my array in a text file line by line instead of
consecutively..
I also tried
txt<< puts line
txt<< "#{puts ""}"
txt<< "#{puts line}"