From c4c6bebecfed8ec6baa3e3624acc7cde87f9fae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 17 Jan 2012 13:25:45 -0300 Subject: Add option to configure Sprockets logger --- actionpack/CHANGELOG.md | 2 ++ actionpack/lib/sprockets/railtie.rb | 2 +- railties/guides/source/configuring.textile | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3