Hi, Is there any way of writing output to the stdout stream of the default webrick server? When debugging sometimes it''s useful to do it the old-school way and just write out some values where you can see them, but "print" within a controller writes to the response stream. thanks -mike
On 7/13/05, Mike Hearn <m.hearn-IH7PeJnNIdscfM+Ka2ujKdBPR1lH4CV8@public.gmane.org> wrote:> Is there any way of writing output to the stdout stream of the default > webrick server? When debugging sometimes it''s useful to do it the > old-school way and just write out some values where you can see them, > but "print" within a controller writes to the response stream.$stderr.puts "moo" works.. but, the log files really are what this sort if thing is supposed to be: logger.debug "my thing: #{@mything.inspect} and then in yaml: #{@mything.to_yml}" -- http://johansorensen.com http://theexciter.com
> $stderr.puts "moo" works..Thanks, that''s what I was after.> but, the log files really are what this sort if thing is supposed to be: > logger.debug "my thing: #{@mything.inspect} and then in yaml: > #{@mything.to_yml}"Ah excellent, built in logging :) I am a complete Ruby Nuby, but this is turning out to be a lot of fun. thanks -mike
Mike Hearn <m.hearn@...> writes:> > Hi, > > Is there any way of writing output to the stdout stream of the default > webrick server? When debugging sometimes it''s useful to do it the > old-school way and just write out some values where you can see them, > but "print" within a controller writes to the response stream. > > thanks -mike >try: warn "some message" this is written to the WEBrick console and works from model, view, and controller code. (someone answered this question for me before on this list)