2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-04-17 21:47:52 -05:00
|
|
|
Rails.application.config.assets.configure do |env|
|
|
|
|
env.logger = Logger.new('/dev/null')
|
|
|
|
end
|
|
|
|
|
2017-08-30 23:06:56 -05:00
|
|
|
module DiscourseRackQuietAssetsLogger
|
|
|
|
def call(env)
|
2017-01-31 14:44:46 -06:00
|
|
|
override = false
|
2013-02-05 13:16:51 -06:00
|
|
|
if (env['PATH_INFO'].index("/assets/") == 0) ||
|
2020-06-11 23:17:28 -05:00
|
|
|
(env['PATH_INFO'].index("mini-profiler-resources") == 0) ||
|
|
|
|
(env['PATH_INFO'].index("/srv/status") == 0)
|
2017-01-31 14:44:46 -06:00
|
|
|
if ::Logster::Logger === Rails.logger
|
|
|
|
override = true
|
|
|
|
Rails.logger.override_level = Logger::ERROR
|
|
|
|
end
|
2013-02-05 13:16:51 -06:00
|
|
|
end
|
|
|
|
|
2017-08-30 23:06:56 -05:00
|
|
|
super(env).tap do
|
2017-01-31 14:44:46 -06:00
|
|
|
if override
|
|
|
|
Rails.logger.override_level = nil
|
|
|
|
end
|
2013-02-05 13:16:51 -06:00
|
|
|
end
|
|
|
|
end
|
2013-02-25 10:42:20 -06:00
|
|
|
end
|
2017-08-30 23:06:56 -05:00
|
|
|
|
|
|
|
Rails::Rack::Logger.prepend DiscourseRackQuietAssetsLogger
|