Class: Hippo::MultiDestinationLogger::Output

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

Instance Method Summary collapse

Constructor Details

#initializeOutput

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

#closeObject



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