diff options
-rwxr-xr-x | bin/mauveserver | 12 | ||||
-rw-r--r-- | lib/mauve/configuration.rb | 2 | ||||
-rw-r--r-- | lib/mauve/mauve_thread.rb | 6 | ||||
-rw-r--r-- | lib/mauve/processor.rb | 2 | ||||
-rw-r--r-- | lib/mauve/server.rb | 1 |
5 files changed, 16 insertions, 7 deletions
diff --git a/bin/mauveserver b/bin/mauveserver index aea9d8c..921e6b3 100755 --- a/bin/mauveserver +++ b/bin/mauveserver @@ -117,8 +117,16 @@ end new.formatter = old.formatter new.level = old.level - Mauve::Server.instance.logger.outputters << new - Mauve::Server.instance.logger.outputters.delete(old) + Mauve::Server.instance.logger.info "Closing #{old.filename}." + + # + # Delete the outputter from each logger. + # + Log4r::Logger.each_logger do |l| + l.outputters << new + l.outputters.delete(old) + end + old.close Mauve::Server.instance.logger.info "Opened #{new.filename}." diff --git a/lib/mauve/configuration.rb b/lib/mauve/configuration.rb index baf6ad1..0d3e520 100644 --- a/lib/mauve/configuration.rb +++ b/lib/mauve/configuration.rb @@ -88,6 +88,8 @@ module Mauve require "log4r/outputter/#{@outputter.downcase}" end + @outputter_name = "Mauve-"+5.times.collect{rand(36).to_s(36)}.join + @args = {} end diff --git a/lib/mauve/mauve_thread.rb b/lib/mauve/mauve_thread.rb index 1aa8619..55ec446 100644 --- a/lib/mauve/mauve_thread.rb +++ b/lib/mauve/mauve_thread.rb @@ -7,6 +7,7 @@ module Mauve def initialize @thread = nil + @stop = true end def logger @@ -59,7 +60,7 @@ module Mauve end def frozen? - defined? @frozen and @frozen and @thread.stop? + self.alive? and self.stop? end def thaw @@ -88,7 +89,7 @@ module Mauve end def stop? - @thread.is_a?(Thread) and @thread.stop? + !@thread.is_a?(Thread) or @thread.stop? end def join(ok_exceptions=[]) @@ -126,7 +127,6 @@ module Mauve self.join end - alias exit stop def kill diff --git a/lib/mauve/processor.rb b/lib/mauve/processor.rb index 15987c2..e3aac54 100644 --- a/lib/mauve/processor.rb +++ b/lib/mauve/processor.rb @@ -36,7 +36,7 @@ module Mauve # break if data.nil? - Timer.instance.freeze unless Timer.instance.frozen? + Timer.instance.freeze if Timer.instance.alive? and !Timer.instance.frozen? logger.debug("Got #{data.inspect} from #{client.inspect}") diff --git a/lib/mauve/server.rb b/lib/mauve/server.rb index 4bd5a0f..f9ea769 100644 --- a/lib/mauve/server.rb +++ b/lib/mauve/server.rb @@ -149,7 +149,6 @@ module Mauve thread_list.delete(Thread.current) THREAD_CLASSES.each do |klass| - # # No need to double check ourselves. # |