Class: Redwing::Logger::MultiIO

Inherits:
Object
  • Object
show all
Defined in:
lib/redwing/logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(*targets) ⇒ MultiIO

Returns a new instance of MultiIO.



43
44
45
# File 'lib/redwing/logger.rb', line 43

def initialize(*targets)
  @targets = targets
end

Instance Method Details

#closeObject



55
56
57
# File 'lib/redwing/logger.rb', line 55

def close
  @targets.each(&:close)
end

#flushObject



51
52
53
# File 'lib/redwing/logger.rb', line 51

def flush
  @targets.each { |t| t.flush if t.respond_to?(:flush) }
end

#writeObject



47
48
49
# File 'lib/redwing/logger.rb', line 47

def write(*)
  @targets.each { |t| t.write(*) }
end