lib/zk/fork_hook.rb in zk-1.9.5 vs lib/zk/fork_hook.rb in zk-1.9.6
- old
+ new
@@ -1,8 +1,8 @@
module ZK
module ForkHook
- include ZK::Logging
+ include ZK::Logger
extend self
@mutex = Mutex.new unless @mutex
@hooks = {
@@ -92,10 +92,14 @@
# register a block that will be called after the fork happens in the child process
def after_fork_in_child(callable=nil, &blk)
register(:after_child, callable || blk)
end
+ def self.logger
+ @logger ||= ::ZK.logger || Zookeeper::Logger::ForwardingLogger.for(::ZK::Logger.wrapped_logger, _zk_logger_name)
+ end
+
class ForkSubscription < Subscription::Base
attr_reader :hook_type
def initialize(hook_type, block)
super(ForkHook, block)
@@ -106,6 +110,7 @@
end # ForkHook
def self.install_fork_hook
require 'zk/install_fork_hooks'
end
+
end # ZK