Class: Hippo::MultiDestinationLogger::Output
- Inherits:
-
Object
- Object
- Hippo::MultiDestinationLogger::Output
- Defined in:
- lib/hippo/logger.rb
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize ⇒ Output
constructor
A new instance of Output.
- #write(*args) ⇒ Object
Constructor Details
#initialize ⇒ Output
Returns a new instance of Output.
8 9 10 11 12 13 |
# File 'lib/hippo/logger.rb', line 8 def initialize @targets = [STDOUT] @targets.push( File.open("log/#{Hippo.config.environment}.log", "a") ) if File.writable?("log") end |
Instance Method Details
#close ⇒ Object
19 20 21 |
# File 'lib/hippo/logger.rb', line 19 def close @targets.each(&:close) end |
#write(*args) ⇒ Object
15 16 17 |
# File 'lib/hippo/logger.rb', line 15 def write(*args) @targets.each {|t| t.write(*args)} end |