Permalink
Browse files

Log the file being processed; update process_css to provide logger

  • Loading branch information...
1 parent 070dabd commit 1d45dcc8bd9f0751d220bac30486a3f364234cb2 @fidothe fidothe committed Apr 14, 2011
Showing with 5 additions and 1 deletion.
  1. +1 −0 lib/cdn_helpers.rb
  2. +4 −1 process_css
View
@@ -31,6 +31,7 @@ def self.hash_file(path, public_root_path, logger)
module CssRewriter
def self.rewrite_css_file(logger, css_file_path, public_root_path, url_prefix = '/')
+ logger.info("Rewriting CSS file URLs in #{css_file_path}")
css_file = File.open(css_file_path)
output = process_css_file(logger, css_file, css_file_path, public_root_path, url_prefix)
File.open(css_file_path, 'w') { |f| f.write(output) }
View
@@ -1,10 +1,13 @@
#!/usr/bin/env ruby
require File.expand_path('lib/cdn_helpers.rb', File.dirname(__FILE__))
+require 'logger'
css_file_path = ARGV[0]
css_file = File.open(css_file_path)
public_root_path = ARGV[1]
url_prefix = ARGV[2]
+logger = Logger.new(STDOUT)
+logger.level = Logger::INFO
-CdnHelpers::CssRewriter.rewrite_css_file(css_file_path, public_root_path, url_prefix)
+CdnHelpers::CssRewriter.rewrite_css_file(logger, css_file_path, public_root_path, url_prefix)

0 comments on commit 1d45dcc

Please sign in to comment.