Sha256: 6202e4e8c1fe99e2823b0f5e7c98815429e895ca37f6b6c9b35060dce70d1a12
Contents?: true
Size: 539 Bytes
Versions: 2
Compression:
Stored size: 539 Bytes
Contents
module Alephant module Logger class Base def initialize(drivers) @drivers = drivers << ::Logger.new(STDOUT) end def write(*args) self.<< *args end def method_missing(name, *args) drivers.each do |driver| driver.send(name, *args) if driver.respond_to? name end end def respond_to?(name) drivers.any? do |driver| driver.respond_to?(name) || super end end private attr_reader :drivers end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
alephant-logger-1.2.1 | lib/alephant/logger/base.rb |
alephant-logger-1.2.0 | lib/alephant/logger/base.rb |