discourse/config/initializers/100-quiet_logger.rb

Failed to ignore revisions in .git-blame-ignore-revs.

27 lines
626 B
Ruby
Raw Normal View History

# frozen_string_literal: true
Rails.application.config.assets.configure do |env|
env.logger = Logger.new('/dev/null')
end
module DiscourseRackQuietAssetsLogger
def call(env)
override = false
2017-07-27 20:20:09 -05:00
if (env['PATH_INFO'].index("/assets/") == 0) ||
2013-02-05 13:16:51 -06:00
(env['PATH_INFO'].index("mini-profiler-resources") == 0)
if ::Logster::Logger === Rails.logger
override = true
Rails.logger.override_level = Logger::ERROR
end
2013-02-05 13:16:51 -06:00
end
super(env).tap do
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
Rails::Rack::Logger.prepend DiscourseRackQuietAssetsLogger