Module: RDFMapper::Logger::Configuration

Defined in:
lib/lib/util/logger.rb

Class Method Summary collapse

Class Method Details

.targetObject



18
19
20
# File 'lib/lib/util/logger.rb', line 18

def target
  @target || to(:stdout)
end

.to(target, level = 4, name = nil) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/lib/util/logger.rb', line 9

def to(target, level = 4, name = nil)
  io = case target
    when :stdout then $stdout
    when :file then File.open(name, 'a+')
    else String
  end
  @target = ::Logger.new(io)
end