Skip to content

Commit

Permalink
Rails 3.2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
thickpaddy committed Apr 18, 2012
1 parent 15a4739 commit 88e821e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/ciunas/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ def initialize(app, opts = {})

def call(env)
if env['X-SILENCE-LOGGER'] || @opts[:silenced].any? {|m| m === env['PATH_INFO'] }
Rails.logger.silence do
begin
# temporarily set the rails log level to error
tmp_log_level = ActiveSupport::BufferedLogger::Severity::ERROR
old_logger_level, Rails.logger.level = Rails.logger.level, tmp_log_level
@app.call(env)
ensure
Rails.logger.level = old_logger_level
end
else
super(env)
Expand Down

0 comments on commit 88e821e

Please sign in to comment.