We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70cf847 commit cf8ed5cCopy full SHA for cf8ed5c
config/environments/development.rb
@@ -1,3 +1,18 @@
1
+class DisableAssetsLogger
2
+ def initialize(app)
3
+ @app = app
4
+ Rails.application.assets.logger = Logger.new('/dev/null')
5
+ end
6
+
7
+ def call(env)
8
+ previous_level = Rails.logger.level
9
+ Rails.logger.level = Logger::ERROR if env['PATH_INFO'].index("/assets/") == 0
10
+ @app.call(env)
11
+ ensure
12
+ Rails.logger.level = previous_level
13
14
+end
15
16
SampleApp::Application.configure do
17
# Settings specified here will take precedence over those in config/application.rb
18
@@ -34,4 +49,7 @@
34
49
35
50
# Expands the lines which load the assets
36
51
config.assets.debug = true
52
53
+ config.assets.logger = false
54
+ config.middleware.insert_before Rails::Rack::Logger, DisableAssetsLogger
37
55
end
0 commit comments