Solves: "gems/mongo-1.6.0/lib/mongo/util/logging.rb:34:in `instrument': undefined method `level' for #<Mongoid::Logger:0x00000103ca7570> (NoMethodError)"

This commit is contained in:
Armin Pašalić 2012-02-22 21:26:59 +01:00
parent 32117ac91c
commit 775ed49e6c
1 changed files with 1 additions and 1 deletions

View File

@ -31,7 +31,7 @@ module Mongo
def instrument(name, payload = {}, &blk)
start_time = Time.now
res = yield
if @logger && (@logger.level == DEBUG_LEVEL)
if @logger && @logger.respond_to?("level") && (@logger.level == DEBUG_LEVEL)
log_operation(name, payload, start_time)
end
res