aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-01-17 13:25:45 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-01-17 14:36:23 -0300
commitc4c6bebecfed8ec6baa3e3624acc7cde87f9fae6 (patch)
tree252ef304e62aca95795dc77f960878ee18421573
parented35f3747c2acfeac140e6d8a44bc0e491fca1a3 (diff)
downloadrails-c4c6bebecfed8ec6baa3e3624acc7cde87f9fae6.tar.gz
rails-c4c6bebecfed8ec6baa3e3624acc7cde87f9fae6.tar.bz2
rails-c4c6bebecfed8ec6baa3e3624acc7cde87f9fae6.zip
Add option to configure Sprockets logger
-rw-r--r--actionpack/CHANGELOG.md2
-rw-r--r--actionpack/lib/sprockets/railtie.rb2
-rw-r--r--railties/guides/source/configuring.textile2
3 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md
index 8a4be5667e..8e870448fd 100644
--- a/actionpack/CHANGELOG.md
+++ b/actionpack/CHANGELOG.md
@@ -1,5 +1,7 @@
## Rails 3.2.0 (unreleased) ##
+* Add config.assets.logger to configure Sprockets logger *Rafael França*
+
* Use a BodyProxy instead of including a Module that responds to
close. Closes #4441 if Active Record is disabled assets are delivered
correctly *Santiago Pastorino*
diff --git a/actionpack/lib/sprockets/railtie.rb b/actionpack/lib/sprockets/railtie.rb
index a7eb03acaf..9f4151e4b3 100644
--- a/actionpack/lib/sprockets/railtie.rb
+++ b/actionpack/lib/sprockets/railtie.rb
@@ -21,7 +21,7 @@ module Sprockets
require 'sprockets'
app.assets = Sprockets::Environment.new(app.root.to_s) do |env|
- env.logger = ::Rails.logger
+ env.logger = config.assets.logger || ::Rails.logger
env.version = ::Rails.env + "-#{config.assets.version}"
if config.assets.cache_store != false
diff --git a/railties/guides/source/configuring.textile b/railties/guides/source/configuring.textile
index 09ef308665..9a6f40b9e6 100644
--- a/railties/guides/source/configuring.textile
+++ b/railties/guides/source/configuring.textile
@@ -156,6 +156,8 @@ 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+.
+
h4. Configuring Generators