How about up'ing the logger level temporarily, like

  ...
  bak_log_level = logger.level
  begin
    logger.level = Logger::ERROR
    # do some stuff ...
    ...
  ensure
    logger.level = bak_log_level
  end
  ...

Jeff

On Sep 28, 5:38 pm, Greg Willits <rails-mailing-l...@andreas-s.net>
wrote:
> Philip Hallstrom wrote:
> > On Sep 28, 2009, at 5:16 PM, Greg Willits wrote:
>
> >> But I could possibly tinker further.
>
> > I'm coming in late so maybe this has mentioned...
>
> > def my_action
> >    ActiveRecord::Base.silence do
> >      ..... nothing AR related will show up in the logs....
> >    end
> > end
>
> > Search the rails source for "silence" to make sure I've got that down
> > right.
>
> Hmm, logical but nope. Still getting queries logged, but that may be
> because I used this technique to add timestamps and log level info to
> the log output. Maybe there's interference. (how could anyone think
> timestamps would not be useful in a log ????????).
>
> http://nopugs.com/2008/07/10/how-to-get-timestamps-in-your-ruby-on-ra...
>
> I'll fiddle more.
>
> -- gw
> --
> 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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to