# File lib/mongo/db.rb, line 595 def profiling_level=(level) oh = BSON::OrderedHash.new oh[:profile] = case level when :off 0 when :slow_only 1 when :all 2 else raise "Error: illegal profiling level value #{level}" end doc = command(oh, :check_response => false) ok?(doc) || raise(MongoDBError, "Error with profile command: #{doc.inspect}") end