From 506148ae8ac86419235e66985b8e51121dd5b7db Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Sat, 23 Jul 2011 21:28:01 -0700 Subject: [PATCH] hide webrick logs, disable livereload by default --- bin/mm-server | 2 +- lib/middleman/guard.rb | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/mm-server b/bin/mm-server index 5894b498..ceac3ce5 100755 --- a/bin/mm-server +++ b/bin/mm-server @@ -15,7 +15,7 @@ module Middleman class_option :port, :aliases => "-p", :default => "4567" class_option :"livereload-port", :default => "35729" - class_option :"livereload", :default => true, :type => :boolean + class_option :"livereload", :default => false, :type => :boolean def start_guard if !File.exists?("config.rb") diff --git a/lib/middleman/guard.rb b/lib/middleman/guard.rb index 4451730d..ac539bcb 100644 --- a/lib/middleman/guard.rb +++ b/lib/middleman/guard.rb @@ -1,6 +1,7 @@ require "guard" require "guard/guard" require "guard/livereload" +require "webrick" module Middleman::Guard def self.start(options={}, livereload={}) @@ -53,12 +54,17 @@ module Guard private def server_start - puts "== The Middleman is standing watch on port #{@options[:port]}" - @server_options = { :Port => @options[:port], :AccessLog => [] } + @server_options = { + :Port => @options[:port], + :Logger => ::WEBrick::Log.new('/dev/null'), + :AccessLog => ::WEBrick::Log.new('/dev/null') + } @server_job = fork do @server_options[:app] = ::Middleman.server.new ::Rack::Server.new(@server_options).start end + + puts "== The Middleman is standing watch on port #{@options[:port]}" end def server_stop