Sha256: aa3cad323d508870fc02bb582da147a4f595d796dad301e1b29145e66e08c602
Contents?: true
Size: 802 Bytes
Versions: 4
Compression:
Stored size: 802 Bytes
Contents
module Liquid module Logging ## # MultiLogger is a simple class for multiplexing ImprovedLogger objects. It # support attach/detach to send messages to any number of loggers. class MultiLogger def initialize(*loggers) @loggers = loggers end # Attach an ImprovedLogger object. def attach(logger) logger.token = @loggers.first.token rescue nil @loggers << logger end # Detach an ImprovedLogger object. def detach(logger) @loggers.delete(logger) end # Delegate all method calls to all attached loggers. # # @private def method_missing(name, *args, &block) @loggers.map do |logger| logger.send(name, *args, &block) end.first end end end end
Version data entries
4 entries across 4 versions & 1 rubygems