<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -22,7 +22,8 @@ module Merb
           :log_delimiter          =&gt; &quot; ~ &quot;,
           :log_auto_flush         =&gt; false,
           :disabled_components    =&gt; [],
-          :deferred_actions       =&gt; []
+          :deferred_actions       =&gt; [],
+          :verbose                =&gt; false
         }
       end
 
@@ -226,6 +227,10 @@ module Merb
             end
           end
 
+          opts.on(&quot;-V&quot;, &quot;--verbose&quot;, &quot;Print extra information&quot;) do
+            options[:verbose] = true
+          end
+
           opts.on(&quot;-?&quot;, &quot;-H&quot;, &quot;--help&quot;, &quot;Show this help message&quot;) do
             puts opts
             exit</diff>
      <filename>lib/merb-core/config.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,25 +22,35 @@ module Merb
         @cluster = cluster
         if @cluster
           @port.to_i.upto(@port.to_i + @cluster.to_i-1) do |port|
+            pidfile = pid_file(port)
+            pid = IO.read(pidfile).chomp.to_i
+
             unless alive?(port)
               remove_pid_file(port)
-              puts &quot;Starting merb server on port: #{port}&quot;
+              puts &quot;Starting merb server on port #{port}, pid file: #{pidfile} and process id is #{pid}&quot;
               daemonize(port)
             else
-              raise &quot;Merb is already running on port: #{port}&quot;
+              raise &quot;Merb is already running: port is #{port}, pid file: #{pidfile}, process id is #{pid}&quot;
             end
           end
         elsif Merb::Config[:daemonize]
+          pidfile = pid_file(port)
+          pid = IO.read(pidfile).chomp.to_i
+
           unless alive?(@port)
+            puts &quot;Removing pid file #{pidfile}, port is #{port}...&quot;
             remove_pid_file(@port)
+            puts &quot;Daemonizing...&quot;
             daemonize(@port)
           else
-            raise &quot;Merb is already running on port: #{port}&quot;
+            raise &quot;Merb is already running: port is #{port}, pid file: #{pidfile}, process id is #{pid}&quot;
           end
         else
           trap('TERM') { exit }
           trap('INT') { puts &quot;\nExiting&quot;; exit }
+          puts &quot;Running bootloaders...&quot;
           BootLoader.run
+          puts &quot;Starting Rack adapter...&quot;
           Merb.adapter.start(Merb::Config.to_hash)
         end
       end
@@ -52,8 +62,11 @@ module Merb
       # Boolean::
       #   True if Merb is running on the specified port.
       def alive?(port)
+        puts &quot;About to check if port #{port} is alive...&quot;
         pidfile = pid_file(port)
+        puts &quot;Pidfile is #{pidfile}...&quot;
         pid = IO.read(pidfile).chomp.to_i
+        puts &quot;Process id is #{pid}&quot;
         Process.kill(0, pid)
         true
       rescue
@@ -72,8 +85,8 @@ module Merb
         begin
           pidfiles = port == &quot;all&quot; ?
             pid_files : [ pid_file(port) ]
-            
-          pidfiles.each do |f|          
+
+          pidfiles.each do |f|
             pid = IO.read(f).chomp.to_i
             begin
               Process.kill(sig, pid)
@@ -98,6 +111,7 @@ module Merb
       # ==== Parameters
       # port&lt;~to_s&gt;:: The port of the Merb process to daemonize.
       def daemonize(port)
+        puts &quot;About to fork...&quot;
         fork do
           Process.setsid
           exit if fork
@@ -117,13 +131,15 @@ module Merb
       def change_privilege
         if Merb::Config[:user]
           if Merb::Config[:group]
+            puts &quot;About to change privilege to group #{Merb::Config[:group]} and user #{Merb::Config[:user]}&quot;
             _change_privilege(Merb::Config[:user], Merb::Config[:group])
           else
+            puts &quot;About to change privilege to user #{Merb::Config[:user]}&quot;
             _change_privilege(Merb::Config[:user])
           end
         end
       end
-      
+
       # Removes a PID file used by the server from the filesystem.
       # This uses :pid_file options from configuration when provided
       # or merb.&lt;port&gt;.pid in log directory by default.
@@ -137,6 +153,7 @@ module Merb
       # instead of the port based PID file.
       def remove_pid_file(port)
         pidfile = pid_file(port)
+        puts &quot;Removing pid file #{pidfile} (port is #{port})&quot;
         FileUtils.rm(pidfile) if File.exist?(pidfile)
       end
 
@@ -153,10 +170,11 @@ module Merb
       # instead of the port based PID file.
       def store_pid(port)
         pidfile = pid_file(port)
+        puts &quot;pid file stored at #{pidfile}&quot;
         FileUtils.mkdir_p(File.dirname(pidfile)) unless File.directory?(File.dirname(pidfile))
         File.open(pidfile, 'w'){ |f| f.write(&quot;#{Process.pid}&quot;) }
       end
-          
+
       # Gets the pid file for the specified port.
       #
       # ==== Parameters
@@ -202,8 +220,8 @@ module Merb
         else
           Dir[Merb.log_path / &quot;merb.*.pid&quot;]
         end
-       end      
-      
+       end
+
       # Change privileges of the process to the specified user and group.
       #
       # ==== Parameters</diff>
      <filename>lib/merb-core/server.rb</filename>
    </modified>
    <modified>
      <diff>@@ -71,7 +71,7 @@ describe Merb::Config do
 
   it &quot;should have server return PIDfile setting as is with no cluster nodes&quot; do
     Merb::Config.parse_args([&quot;-P&quot;, &quot;pidfile&quot;, &quot;-p&quot;, &quot;6000&quot;])
-    Merb::Server.pid_file(6000).should == &quot;pidfile&quot;    
+    Merb::Server.pid_file(6000).should == &quot;pidfile&quot;
     Merb::Server.pid_files.should == [&quot;pidfile&quot;]
   end
 
@@ -79,7 +79,7 @@ describe Merb::Config do
     Merb::Config.parse_args([&quot;-P&quot;, &quot;/tmp/merb.pidfile&quot;, &quot;-c&quot;, &quot;2&quot;, &quot;-p&quot;, &quot;6000&quot;])
     Merb::Server.pid_file(6000).should == &quot;/tmp/merb.6000.pidfile&quot;
     Merb::Server.pid_file(6001).should == &quot;/tmp/merb.6001.pidfile&quot;
-    
+
     Dir.should_receive(:[]).with(&quot;/tmp/merb.*.pidfile&quot;)
     Merb::Server.pid_files
   end
@@ -87,7 +87,7 @@ describe Merb::Config do
   it &quot;should support default PIDfile setting&quot; do
     Merb::Config.parse_args([&quot;-p&quot;, &quot;6000&quot;])
     Merb::Server.pid_file(6000).should == Merb.log_path / &quot;merb.6000.pid&quot;
-    
+
     Dir.should_receive(:[]).with(Merb.log_path / &quot;merb.*.pid&quot;)
     Merb::Server.pid_files
   end
@@ -164,4 +164,19 @@ describe Merb::Config do
     $TESTING = true; Merb::Config[:testing] = false # reset
   end
 
+  it &quot;supports -V to turn on verbose mode&quot; do
+    Merb::Config[:verbose] = false
+    Merb::Config.parse_args([&quot;-V&quot;])
+    Merb::Config[:verbose].should be(true)
+  end
+
+  it &quot;supports --verbose to turn on verbose mode&quot; do
+    Merb::Config[:verbose] = false
+    Merb::Config.parse_args([&quot;--verbose&quot;])
+    Merb::Config[:verbose].should be(true)
+  end
+
+  it &quot;has verbose mode turned off by default&quot; do
+    Merb::Config[:verbose].should be(false)
+  end
 end</diff>
      <filename>spec/private/config/config_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>bc1a1b78bace56503c8a567bdc1dfe6e9a14edbe</id>
    </parent>
  </parents>
  <author>
    <name>Michael S. Klishin</name>
    <email>michael@novemberain.com</email>
  </author>
  <url>http://github.com/wycats/merb-core/commit/304e19d16f0d12e9fc69c1435904342555b1382d</url>
  <id>304e19d16f0d12e9fc69c1435904342555b1382d</id>
  <committed-date>2008-05-12T07:06:04-07:00</committed-date>
  <authored-date>2008-05-12T07:06:04-07:00</authored-date>
  <message>Add -V/--verbose options.</message>
  <tree>88f6f4fdc11024377b48a8e44e82893adc0bc90b</tree>
  <committer>
    <name>Michael S. Klishin</name>
    <email>michael@novemberain.com</email>
  </committer>
</commit>
