Merge pull request #4518 from guilleiguaran/silent-sprockets-logger-3-2-stable

Silent Sprockets logger when config.assets.logger is set to false (3-2-stable)
This commit is contained in:
José Valim
2012-01-18 05:20:20 -08:00
4 changed files with 8 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
## Rails 3.2.0 (unreleased) ##
* Setting config.assets.logger to false turn off Sprockets logger *Guillermo Iguaran*
* Add `config.action_dispatch.default_charset` to configure default charset for ActionDispatch::Response. *Carlos Antonio da Silva*
* Deprecate setting default charset at controller level, use the new `config.action_dispatch.default_charset` instead. *Carlos Antonio da Silva*

View File

@@ -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

View File

@@ -156,8 +156,7 @@ Rails 3.1, by default, is set up to use the +sprockets+ gem to manage assets wit
* +config.assets.compile+ is a boolean that can be used to turn on live Sprockets compilation in production.
* +config.assets.logger+ accepts a logger conforming to the interface of Log4r or the default Ruby +Logger+ class. Defaults to the same configured at +config.logger+.
* +config.assets.logger+ accepts a logger conforming to the interface of Log4r or the default Ruby +Logger+ class. Defaults to the same configured at +config.logger+. Setting +config.assets.logger+ to false will turn off served assets logging.
h4. Configuring Generators

View File

@@ -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