Class: Racknga::Middleware::Log::Logger — racknga - Ranguba

Class: Racknga::Middleware::Log::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/racknga/middleware/log.rb

Instance Method Summary (collapse)

Constructor Details

- (Logger) initialize(database)

A new instance of Logger



101
102
103
104
# File 'lib/racknga/middleware/log.rb', line 101

def initialize(database)
  @database = database
  @entries = @database.entries
end

Instance Method Details

- (Object) log(tag, path, options = {})



106
107
108
109
110
# File 'lib/racknga/middleware/log.rb', line 106

def log(tag, path, options={})
  @entries.add(options.merge(:time_stamp => Time.now,
                             :tag => tag,
                             :path => path))
end