diff --git a/middleman-core/lib/middleman-core/application.rb b/middleman-core/lib/middleman-core/application.rb index 3b05b834..49de6595 100644 --- a/middleman-core/lib/middleman-core/application.rb +++ b/middleman-core/lib/middleman-core/application.rb @@ -378,6 +378,8 @@ module Middleman # # @private def process_request + start_time = Time.now + # Normalize the path and add index if we're looking at a directory @original_path = env["PATH_INFO"].dup @escaped_path = @original_path.gsub("%20", " ") @@ -418,7 +420,7 @@ module Middleman end # End the request - puts "== Finishing Request: #{self.current_path}" if logging? + puts "== Finishing Request: #{self.current_path} (#{(Time.now - start_time).round(2)}s)" if logging? halt res.finish end @@ -531,24 +533,21 @@ module Middleman # @param [Hash] options to pass to Rack::Server.new # @return [Rack::Server] def start_server(options={}) - require "webrick" - opts = { :Port => options[:port] || 4567, :Host => options[:host] || "0.0.0.0", :AccessLog => [] } - # opts[:Logger] = WEBrick::Log::new("/dev/null", 7) if !options[:logging] - app_class = options[:app] ||= ::Middleman.server.inst opts[:app] = app_class - # Disable for Beta 1. See if people notice. + # Use Thin because Webrick gets confused and mixes + # up responses. + # TODO: Figure that out and drop Thin dependency require "thin" ::Thin::Logging.silent = !options[:logging] opts[:server] = 'thin' - # opts[:server] = 'webrick' server = ::Rack::Server.new(opts) server.start diff --git a/middleman-core/lib/middleman-core/sitemap/resource.rb b/middleman-core/lib/middleman-core/sitemap/resource.rb index 7832435a..0c6b3296 100644 --- a/middleman-core/lib/middleman-core/sitemap/resource.rb +++ b/middleman-core/lib/middleman-core/sitemap/resource.rb @@ -88,6 +88,7 @@ module Middleman::Sitemap def render(opts={}, locs={}, &block) return File.open(source_file).read unless template? + start_time = Time.now puts "== Render Start: #{source_file}" if app.logging? md = metadata.dup @@ -106,7 +107,7 @@ module Middleman::Sitemap app.instance_eval(&block) if block_given? result = app.render_template(source_file, locs, opts) - puts "== Render End: #{source_file}" if app.logging? + puts "== Render End: #{source_file} (#{(Time.now - start_time).round(2)}s)" if app.logging? result end