monolog
Version:
Log with Monolog
44 lines (34 loc) • 1.42 kB
JavaScript
// Generated by CoffeeScript 1.6.3
var AbstractHandler, AbstractProcessingHandler, _ref,
__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; };
AbstractHandler = require('./AbstractHandler');
AbstractProcessingHandler = (function(_super) {
__extends(AbstractProcessingHandler, _super);
function AbstractProcessingHandler() {
_ref = AbstractProcessingHandler.__super__.constructor.apply(this, arguments);
return _ref;
}
AbstractProcessingHandler.prototype.handle = function(record, cb) {
if (this.isHandling(record)) {
record = this.processRecord(record);
record.formatted = this.getFormatter() ? this.getFormatter().format(record) : record.message;
this.write(record, cb);
this.bubble === false;
return false;
} else {
return false;
}
};
AbstractProcessingHandler.prototype.write = function(record, cb) {
if (cb instanceof Function) {
cb(void 0, void 0, record, this);
}
return this.bubble;
};
return AbstractProcessingHandler;
})(AbstractHandler);
module.exports = AbstractProcessingHandler;
/*
//@ sourceMappingURL=AbstractProcessingHandler.map
*/