From: tom Date: Tue, 18 Dec 2007 21:43:46 +0000 (-0800) Subject: log register/deregister of process exit events X-Git-Url: https://repo.or.cz/w/god.git/commitdiff_plain/bafee44526f528b3a44db9aeacf71dfc973f65cf log register/deregister of process exit events --- diff --git a/History.txt b/History.txt index ac3f3c9..34d08b1 100644 --- a/History.txt +++ b/History.txt @@ -1,3 +1,7 @@ +== 0.6.3 / 2007-12-18 + * Minor Enhancements + * Output ProcessExits registration/deregistration info + == 0.6.2 / 2007-12-17 * Minor Enhancements * Output registered PID for ProcessExits diff --git a/Rakefile b/Rakefile index 1d92fdd..5268863 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,7 @@ require 'rubygems' require 'hoe' -Hoe.new('god', '0.6.2') do |p| +Hoe.new('god', '0.6.3') do |p| p.rubyforge_name = 'god' p.author = 'Tom Preston-Werner' p.email = 'tom@rubyisawesome.com' diff --git a/lib/god.rb b/lib/god.rb index f95c2ec..cd4e321 100644 --- a/lib/god.rb +++ b/lib/god.rb @@ -132,7 +132,7 @@ class Module end module God - VERSION = '0.6.2' + VERSION = '0.6.3' LOG_BUFFER_SIZE_DEFAULT = 1000 PID_FILE_DIRECTORY_DEFAULT = '/var/run/god' diff --git a/lib/god/conditions/process_exits.rb b/lib/god/conditions/process_exits.rb index 4b0437d..de3a265 100644 --- a/lib/god/conditions/process_exits.rb +++ b/lib/god/conditions/process_exits.rb @@ -41,6 +41,9 @@ module God self.info = "process #{pid} exited #{extra.inspect}" Hub.trigger(self) end + + msg = "#{self.watch.name} registered 'proc_exit' event for pid #{pid}" + applog(self.watch, :info, msg) rescue StandardError raise EventRegistrationFailedError.new end @@ -50,6 +53,9 @@ module God if File.exist?(self.watch.pid_file) pid = File.read(self.watch.pid_file).strip.to_i EventHandler.deregister(pid, :proc_exit) + + msg = "#{self.watch.name} deregistered 'proc_exit' event for pid #{pid}" + applog(self.watch, :info, msg) else applog(self.watch, :error, "#{self.watch.name} could not deregister: no such PID file #{self.watch.pid_file} (#{self.base_name})") end