UNPKG

monolog

Version:

Log with Monolog

42 lines (33 loc) 1.3 kB
// Generated by CoffeeScript 1.6.3 "use strict"; var Abstractprocessinghandler, MongoDBHandler, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__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); function MongoDBHandler(mongodb, collection, level, bubble) { this.mongodb = mongodb; this.collection = collection != null ? collection : "log"; if (level == null) { level = 100; } if (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) { _this.mongodb.close(); return cb(err, res, record, _this); }); return this.bubble; }; return MongoDBHandler; })(Abstractprocessinghandler); module.exports = MongoDBHandler; /* //@ sourceMappingURL=MongoDBHandler.map */