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