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

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

Instance Method Summary collapse

Constructor Details

#initialize(database) ⇒ Logger

Returns 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

#log(tag, path, options = {}) ⇒ Object



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