def start_monitor(interval=10)
      t = MonitorThread.new do
        loop do
          break if Thread.current.should_exit

          begin
            activate_levels
          rescue => e
            $stderr.puts "Failure activating log levels: #{e}"
          end
          sleep interval
        end
      end

      at_exit { t.should_exit = true }

      t
    end
def start_monitor(interval=10)
      t = MonitorThread.new do
        loop do
          break if Thread.current.should_exit

          begin
            activate_levels
          rescue => e
            $stderr.puts "Failure activating log levels: #{e}"
          end
          sleep interval
        end
      end

      at_exit { t.should_exit = true }

      t
    end
Convenience method for starting a thread to watch for changes in log
 levels and apply them.  You don't need to use this if you are manually
 calling activate levels at all your entry points.

 @param [Integer] How long to sleep between checks
 @return [Thread] The monitor thread