// Generated by CoffeeScript 1.6.3
"use strict";
var Abstractprocessinghandler, MongoDBHandler,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { Eif (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
Abstractprocessinghandler = require('./AbstractProcessingHandler');
MongoDBHandler = (function(_super) {
__extends(MongoDBHandler, _super);
/*
@param {MongoClient} @mongodb
@param {String} @collection
@param {Number} level=100
@param {Boolean} bubble=true
*/
function MongoDBHandler(mongodb, collection, level, bubble) {
this.mongodb = mongodb;
this.collection = collection != null ? collection : "log";
Eif (level == null) {
level = 100;
}
Eif (bubble == null) {
bubble = true;
}
MongoDBHandler.__super__.constructor.call(this, level, bubble);
}
MongoDBHandler.prototype.write = function(record, cb) {
var _this = this;
this.mongodb.collection(this.collection).insert(record, function(err, res) {
return cb(err, res, record, _this);
});
return this.bubble;
};
return MongoDBHandler;
})(Abstractprocessinghandler);
module.exports = MongoDBHandler;
/*
//@ sourceMappingURL=MongoDBHandler.map
*/
|