Class: Dat::Logger

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

Defined Under Namespace

Classes: Log

Instance Method Summary collapse

Constructor Details

#initialize(opt = {}) ⇒ Logger

Returns a new instance of Logger.



3
4
5
6
# File 'lib/dat/logger.rb', line 3

def initialize(opt={})
  @opt = opt.merge(:timed => true)
  @logs = {}
end

Instance Method Details

#[](lid) ⇒ Object



8
9
10
# File 'lib/dat/logger.rb', line 8

def [](lid)
  @logs[lid] ||= Logger::Log.new(lid, @opt)
end

#create(lid) ⇒ Object



12
13
14
# File 'lib/dat/logger.rb', line 12

def create(lid)
  @logs[lid] = Logger::Log.new(lid, @opt)
end