lib/logging/logger.rb in logging-1.0.0 vs lib/logging/logger.rb in logging-1.1.0

- old
+ new

@@ -49,12 +49,25 @@ name = repo.to_key(args.shift) @mutex.synchronize do logger = repo[name] if logger.nil? - logger = super(name, *args) - repo[name] = logger - repo.children(name).each {|c| c.__send__(:parent=, logger)} + + master = repo.master_for(name) + if master + if repo.has_logger?(master) + logger = repo[master] + else + logger = super(master) + repo[master] = logger + repo.children(master).each {|c| c.__send__(:parent=, logger)} + end + repo[name] = logger + else + logger = super(name) + repo[name] = logger + repo.children(name).each {|c| c.__send__(:parent=, logger)} + end end logger end end alias :[] :new