From 8189abba9cafb77ddca984e08907515153b58bdc Mon Sep 17 00:00:00 2001 From: Jared Beck Date: Thu, 4 Jun 2020 15:52:40 -0400 Subject: [PATCH] Docs: Customization example: log_level, single task --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 45d2d35f..ee1d8b80 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,17 @@ Each asset task will invoke `assets:environment` first. By default this loads th Also see [Sprockets::Rails::Task](https://github.com/rails/sprockets-rails/blob/master/lib/sprockets/rails/task.rb) and [Rake::SprocketsTask](https://github.com/rails/sprockets/blob/master/lib/rake/sprocketstask.rb). +##### Example: Customizing the log_level of a single task + +After `Rails.application.load_tasks` has happened, it's necessary to `clear` existing tasks before re-generating them. + +``` +Rake::Task['assets:precompile'].clear +Rake::SprocketsTask.new do |t| + t.log_level = ::Logger::WARN # Default is INFO +end +``` + ### Initializer options **`config.assets.unknown_asset_fallback`**