Skip to content

Commit

Permalink
disable logging of assets
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyril Fluck authored and Cyril Fluck committed Jan 28, 2012
1 parent 16765de commit 9fb65b1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions config/initializers/quiet_assets.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Rails.application.assets.logger = Logger.new('/dev/null')
Rails::Rack::Logger.class_eval do
def call_with_quiet_assets(env)
previous_level = Rails.logger.level
Rails.logger.level = Logger::ERROR if env['PATH_INFO'].index("/assets/") == 0
call_without_quiet_assets(env).tap do
Rails.logger.level = previous_level
end
end
alias_method_chain :call, :quiet_assets
end

0 comments on commit 9fb65b1

Please sign in to comment.