mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 23:55:19 +08:00
a898d6a02a
This caused info/warning to be consistently missing in dev mode when using puma
25 lines
612 B
Ruby
25 lines
612 B
Ruby
Rails.application.config.assets.configure do |env|
|
|
env.logger = Logger.new('/dev/null')
|
|
end
|
|
|
|
Rails::Rack::Logger.class_eval do
|
|
def call_with_quiet_assets(env)
|
|
|
|
override = false
|
|
if (env['PATH_INFO'].index("/assets/") == 0) or
|
|
(env['PATH_INFO'].index("mini-profiler-resources") == 0)
|
|
if ::Logster::Logger === Rails.logger
|
|
override = true
|
|
Rails.logger.override_level = Logger::ERROR
|
|
end
|
|
end
|
|
|
|
call_without_quiet_assets(env).tap do
|
|
if override
|
|
Rails.logger.override_level = nil
|
|
end
|
|
end
|
|
end
|
|
alias_method_chain :call, :quiet_assets
|
|
end
|