Class: ProxyLogger

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*targets) ⇒ ProxyLogger

Returns a new instance of ProxyLogger.



3
4
5
# File 'lib/proxy_logger.rb', line 3

def initialize(*targets)
  @targets = targets.flatten
end

Instance Attribute Details

#targetsObject (readonly)

Returns the value of attribute targets.



2
3
4
# File 'lib/proxy_logger.rb', line 2

def targets
  @targets
end

Instance Method Details

#closeObject



13
14
15
# File 'lib/proxy_logger.rb', line 13

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

#write(*args) ⇒ Object



7
8
9
10
11
# File 'lib/proxy_logger.rb', line 7

def write(*args)
  @targets.each do |t|
    t.write(*args)
  end
end