Hello, I was wondering if I could sent any messages to the logger (console command) in RoR, I saw someone do it, I just cannot remember what he wrote. "Console command" => when you type ruby script/server and the server start, could I use that to debug my Web Application? Regards, Jamal -- Posted via ruby-forum.com. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Tue, Mar 06, 2007 at 09:28:46PM +0100, Jamal Soueidan wrote :> I was wondering if I could sent any messages to the logger (console > command) in RoR, I saw someone do it, I just cannot remember what he > wrote.Action Pack provides a logger. Have a look to ri Logger: you can use: logger.info(''French cheese rocks''), logger.fatal(''Django sucks''), ... Those are writtent in log/*.log You can also use breakpoints (ruby script/breakpointer) for debugging. -- ,========================. | Pierre-Alexandre Meyer | | email : pam-1sEOgp2Wo8Qdnm+yROfE0A@public.gmane.org | `========================'' --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pierre-Alexandre Meyer wrote:> On Tue, Mar 06, 2007 at 09:28:46PM +0100, Jamal Soueidan wrote : >> I was wondering if I could sent any messages to the logger (console >> command) in RoR, I saw someone do it, I just cannot remember what he >> wrote. > > Action Pack provides a logger. Have a look to ri Logger: > you can use: logger.info(''French cheese rocks''), logger.fatal(''Django > sucks''), ... Those are writtent in log/*.log > > You can also use breakpoints (ruby script/breakpointer) for debugging. > > -- > ,========================. > | Pierre-Alexandre Meyer | > | email : pam-1sEOgp2Wo8Qdnm+yROfE0A@public.gmane.org | > `========================''I did what you wrote, but I cannot find the output anywhere on the screen :S any other easy way to debug my web application? please :) -- Posted via ruby-forum.com. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> I did what you wrote, but I cannot find the output anywhere on the > screen :S any other easy way to debug my web application? please :)If you''re running in development mode, the output will be written to log/development.log. I tend to leave a terminal open running ''tail -f log/development.log''. Because all output is rendered through a View, it''s not trivial to do debug writes into the HTML itself, like you would in PHP, but the logfile is a better approach anyway. Gwyn. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Gwyn Morfey wrote:>> I did what you wrote, but I cannot find the output anywhere on the >> screen :S any other easy way to debug my web application? please :) > If you''re running in development mode, the output will be written to > log/development.log. I tend to leave a terminal open running ''tail -f > log/development.log''. > > Because all output is rendered through a View, it''s not trivial to do > debug writes into the HTML itself, like you would in PHP, but the > logfile is a better approach anyway. > > Gwyn.I''m running ruby under Windows, we don''t have tail command? -- Posted via ruby-forum.com. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sure. If you want console debug output (so stuff gets written in the console where you typed "ruby script/server", just use puts <string>. You really should use the logging support though. logger.debug and logger.info <string> do that in your code. On 3/6/07, Jamal Soueidan <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hello, > > I was wondering if I could sent any messages to the logger (console > command) in RoR, I saw someone do it, I just cannot remember what he > wrote. > > "Console command" => when you type ruby script/server and the server > start, could I use that to debug my Web Application? > > Regards, > Jamal > > -- > Posted via ruby-forum.com. > > > >-- -Eric Price "The greatest error in the history of searching for meaning is assuming that it is found outside one''s self." --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Tue, Mar 06, 2007 at 09:14:30PM -0000, Gwyn Morfey wrote :> Because all output is rendered through a View, it''s not trivial to do > debug writes into the HTML itself, like you would in PHP, but the > logfile is a better approach anyway.You can use @debug(params) for instance. A ugly hack would be: logger.warn(''poy!'') in the controller File.read("#{RAILS_ROOT}/log/development.log") in the view :/ But why debug in the view? Just use breakpoints. -- ,========================. | Pierre-Alexandre Meyer | | email : pam-1sEOgp2Wo8Qdnm+yROfE0A@public.gmane.org | `========================'' --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Tue, Mar 06, 2007 at 10:05:34PM +0100, Jamal Soueidan wrote :> I did what you wrote, but I cannot find the output anywhere on the > screen :S any other easy way to debug my web application? please :)└─(22:30:%)── ruby script/console>> logger = Logger.new(''log/development.log'')=> #<Logger:0xb69fa4dc @progname=nil, @level=0, @logdev=#<Logger::LogDevice:0xb69fa48c @shift_age=0, @filename="log/development.log", @mutex=#<Logger::LogDevice::LogDeviceMutex:0xb69fa464 @mon_entering_queue=[], @mon_count=0, @mon_owner=nil, @mon_waiting_queue=[]>, @dev=#<File:log/development.log>, @shift_size=1048576>, @formatter=nil, @default_formatter=#<Logger::Formatter:0xb69fa4b4 @datetime_format=nil>>>> logger.warn(''WTF?!'')=> true>> exit└─(1:22:31:%)── tail -1 log/development.log WTF?! Hope that helps. -- ,========================. | Pierre-Alexandre Meyer | | email : pam-1sEOgp2Wo8Qdnm+yROfE0A@public.gmane.org | `========================'' --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Use mTail. ophilipp.free.fr/op_tail.htm Free. For windows. -- Wes On Mar 6, 3:21 pm, Jamal Soueidan <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Gwyn Morfey wrote: > >> I did what you wrote, but I cannot find the output anywhere on the > >> screen :S any other easy way to debug my web application? please :) > > If you''re running in development mode, the output will be written to > > log/development.log. I tend to leave a terminal open running ''tail -f > > log/development.log''. > > > Because all output is rendered through a View, it''s not trivial to do > > debug writes into the HTML itself, like you would in PHP, but the > > logfile is a better approach anyway. > > > Gwyn. > > I''m running ruby under Windows, we don''t have tail command? > > -- > Posted viahttp://www.ruby-forum.com.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks :) -- Posted via ruby-forum.com. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Tue, Mar 06, 2007 at 01:32:35PM -0800, wesgarrison wrote :> Free. For windows.I guess PowerShell have a tail cmd. -- ,========================. | Pierre-Alexandre Meyer | | email : pam-1sEOgp2Wo8Qdnm+yROfE0A@public.gmane.org | `========================'' --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---