I run rails 2.1 and I have a rails task that imports a lot of data and it''s bloating my development log. I''d like to disable (or reduce) logging during this particular task, but not globally. I''ve read that there is a logger.silence block (http://wiki.rubyonrails.org/rails/ pages/HowtoSelectivelySuppressLogging) that would do this. But within a rake task, how do I reference the logger instance being used to call the silence method? Or is there another way to accomplish this? --~--~---------~--~----~------------~-------~--~----~ 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 http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Jul 3, 6:48 pm, Jobu <rosens...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I run rails 2.1 and I have a rails task that imports a lot of data and > it''s bloating my development log. I''d like to disable (or reduce) > logging during this particular task, but not globally. I''ve read that > there is a logger.silence block (http://wiki.rubyonrails.org/rails/ > pages/HowtoSelectivelySuppressLogging) that would do this. But within > a rake task, how do I reference the logger instance being used to call > the silence method?Unless you''re doing something magic I would imagine it''s just RAILS_DEFAULT_LOGGER. Fred> > Or is there another way to accomplish this?--~--~---------~--~----~------------~-------~--~----~ 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 http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Jul 3, 2:03 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jul 3, 6:48 pm, Jobu <rosens...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I run rails 2.1 and I have a rails task that imports a lot of data and > > it''s bloating my development log. I''d like to disable (or reduce) > > logging during this particular task, but not globally. I''ve read that > > there is a logger.silence block (http://wiki.rubyonrails.org/rails/ > > pages/HowtoSelectivelySuppressLogging) that would do this. But within > > a rake task, how do I reference the logger instance being used to call > > the silence method? > > Unless you''re doing something magic I would imagine it''s just > RAILS_DEFAULT_LOGGER. >Thanks, that was it. FWIW ActiveRecord::Base.logger also worked. --~--~---------~--~----~------------~-------~--~----~ 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 http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---