aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-01-17 23:28:55 -0800
committerJosé Valim <jose.valim@gmail.com>2012-01-17 23:28:55 -0800
commit5b9a506ef6b72c93901e94a0f738c1991f8d5852 (patch)
treed963c7abe41b1723993f3a69c447b5e5f31e9520
parent5065d17f706e2271837e759e25ba1cc291b916dc (diff)
parent226783d1e8891a38d4a61017952528970dba903d (diff)
downloadrails-5b9a506ef6b72c93901e94a0f738c1991f8d5852.tar.gz
rails-5b9a506ef6b72c93901e94a0f738c1991f8d5852.tar.bz2
rails-5b9a506ef6b72c93901e94a0f738c1991f8d5852.zip
Merge pull request #4512 from guilleiguaran/silent-sprockets-logger
Silent Sprockets logger when config.assets.logger is set to false
-rw-r--r--actionpack/lib/sprockets/railtie.rb5
-rw-r--r--railties/lib/rails/application/configuration.rb1
2 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/sprockets/railtie.rb b/actionpack/lib/sprockets/railtie.rb
index 9f4151e4b3..44ddab0950 100644
--- a/actionpack/lib/sprockets/railtie.rb
+++ b/actionpack/lib/sprockets/railtie.rb
@@ -21,9 +21,12 @@ module Sprockets
require 'sprockets'
app.assets = Sprockets::Environment.new(app.root.to_s) do |env|
- env.logger = config.assets.logger || ::Rails.logger
env.version = ::Rails.env + "-#{config.assets.version}"
+ if config.assets.logger != false
+ env.logger = config.assets.logger || ::Rails.logger
+ end
+
if config.assets.cache_store != false
env.cache = ActiveSupport::Cache.lookup_store(config.assets.cache_store) || ::Rails.cache
end
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb
index da0d425ef2..9e9d26a783 100644
--- a/railties/lib/rails/application/configuration.rb
+++ b/railties/lib/rails/application/configuration.rb
@@ -57,6 +57,7 @@ module Rails
@assets.js_compressor = nil
@assets.css_compressor = nil
@assets.initialize_on_precompile = true
+ @assets.logger = nil
end
def compiled_asset_path