2016-04-17 22:47:52 -04:00
|
|
|
Rails.application.config.assets.configure do |env|
|
|
|
|
env.logger = Logger.new('/dev/null')
|
|
|
|
end
|
|
|
|
|
2013-02-05 14:16:51 -05:00
|
|
|
Rails::Rack::Logger.class_eval do
|
|
|
|
def call_with_quiet_assets(env)
|
2017-01-31 15:44:46 -05:00
|
|
|
|
|
|
|
override = false
|
2013-02-05 14:16:51 -05:00
|
|
|
if (env['PATH_INFO'].index("/assets/") == 0) or
|
|
|
|
(env['PATH_INFO'].index("mini-profiler-resources") == 0)
|
2017-01-31 15:44:46 -05:00
|
|
|
if ::Logster::Logger === Rails.logger
|
|
|
|
override = true
|
|
|
|
Rails.logger.override_level = Logger::ERROR
|
|
|
|
end
|
2013-02-05 14:16:51 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
call_without_quiet_assets(env).tap do
|
2017-01-31 15:44:46 -05:00
|
|
|
if override
|
|
|
|
Rails.logger.override_level = nil
|
|
|
|
end
|
2013-02-05 14:16:51 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
alias_method_chain :call, :quiet_assets
|
2013-02-25 11:42:20 -05:00
|
|
|
end
|