Class: Herbert::LoggingProviders::MongoProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/herbert/AppLogger.rb

Overview

Persists log in DB

Constant Summary collapse

Collection =
'logs'

Instance Method Summary collapse

Constructor Details

#initialize(db) ⇒ MongoProvider

Returns a new instance of MongoProvider.



86
87
88
# File 'lib/herbert/AppLogger.rb', line 86

def initialize(db)
	@db = db
end

Instance Method Details

#idBoolean

FIXME “Flag” indicating that this provider returns IDs

Returns:

  • (Boolean)


99
100
101
# File 'lib/herbert/AppLogger.rb', line 99

def id
	true
end

#save(log) ⇒ Object

Parameters:



91
92
93
# File 'lib/herbert/AppLogger.rb', line 91

def save(log)
	@db[Collection].save(log)
end