winston-aws-cloudwatch
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -53,6 +53,8 @@ 'use strict'; | ||
maxSequenceTokenAge: -1, | ||
formatLogItem: _cloudwatchEventFormatter2.default.formatLogItem, | ||
formatLog: null, | ||
formatLogItem: null, | ||
createLogGroup: false, | ||
createLogStream: false | ||
}); | ||
this._formatter = new _cloudwatchEventFormatter2.default(this._options); | ||
this._sequenceTokenInfo = null; | ||
@@ -131,2 +133,4 @@ this._client = new _awsSdk2.default.CloudWatchLogs(this._options.awsConfig); | ||
value: function _putLogEvents(batch, sequenceToken) { | ||
var _this5 = this; | ||
debug('putLogEvents', { batch: batch, sequenceToken: sequenceToken }); | ||
@@ -136,3 +140,5 @@ var params = { | ||
logStreamName: this._logStreamName, | ||
logEvents: batch.map(this._options.formatLogItem), | ||
logEvents: batch.map(function (item) { | ||
return _this5._formatter.formatLogItem(item); | ||
}), | ||
sequenceToken: sequenceToken | ||
@@ -152,3 +158,3 @@ }; | ||
value: function _fetchAndStoreSequenceToken() { | ||
var _this5 = this; | ||
var _this6 = this; | ||
@@ -158,3 +164,3 @@ debug('fetchSequenceToken'); | ||
var uploadSequenceToken = _ref2.uploadSequenceToken; | ||
return _this5._storeSequenceToken(uploadSequenceToken); | ||
return _this6._storeSequenceToken(uploadSequenceToken); | ||
}); | ||
@@ -173,3 +179,3 @@ } | ||
value: function _findLogStream(nextToken) { | ||
var _this6 = this; | ||
var _this7 = this; | ||
@@ -188,3 +194,3 @@ debug('findLogStream', { nextToken: nextToken }); | ||
var logStreamName = _ref4.logStreamName; | ||
return logStreamName === _this6._logStreamName; | ||
return logStreamName === _this7._logStreamName; | ||
}); | ||
@@ -197,3 +203,3 @@ if (match) { | ||
} | ||
return _this6._findLogStream(nextToken); | ||
return _this7._findLogStream(nextToken); | ||
}); | ||
@@ -206,2 +212,2 @@ } | ||
exports.default = CloudWatchClient; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIj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AgICBuZXh0VG9rZW5cclxuICAgIH1cclxuICAgIHJldHVybiB0aGlzLl9jbGllbnQuZGVzY3JpYmVMb2dTdHJlYW1zKHBhcmFtcykucHJvbWlzZSgpXHJcbiAgICAgIC50aGVuKCh7bG9nU3RyZWFtcywgbmV4dFRva2VufSkgPT4ge1xyXG4gICAgICAgIGNvbnN0IG1hdGNoID0gZmluZChsb2dTdHJlYW1zLFxyXG4gICAgICAgICAgKHtsb2dTdHJlYW1OYW1lfSkgPT4gKGxvZ1N0cmVhbU5hbWUgPT09IHRoaXMuX2xvZ1N0cmVhbU5hbWUpKVxyXG4gICAgICAgIGlmIChtYXRjaCkge1xyXG4gICAgICAgICAgcmV0dXJuIG1hdGNoXHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChuZXh0VG9rZW4gPT0gbnVsbCkge1xyXG4gICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdMb2cgc3RyZWFtIG5vdCBmb3VuZCcpXHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB0aGlzLl9maW5kTG9nU3RyZWFtKG5leHRUb2tlbilcclxuICAgICAgfSlcclxuICB9XHJcbn1cclxuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 |
@@ -27,10 +27,20 @@ 'use strict'; | ||
function CloudWatchEventFormatter() { | ||
var _ref = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
var formatLog = _ref.formatLog; | ||
var formatLogItem = _ref.formatLogItem; | ||
(0, _classCallCheck3.default)(this, CloudWatchEventFormatter); | ||
if (typeof formatLog === 'function') { | ||
this.formatLog = formatLog; | ||
} else if (typeof formatLogItem === 'function') { | ||
this.formatLogItem = formatLogItem; | ||
} | ||
} | ||
(0, _createClass3.default)(CloudWatchEventFormatter, null, [{ | ||
(0, _createClass3.default)(CloudWatchEventFormatter, [{ | ||
key: 'formatLogItem', | ||
value: function formatLogItem(item) { | ||
return { | ||
message: CloudWatchEventFormatter._logItemToCloudWatchMessage(item), | ||
message: this.formatLog(item), | ||
timestamp: item.date | ||
@@ -40,4 +50,4 @@ }; | ||
}, { | ||
key: '_logItemToCloudWatchMessage', | ||
value: function _logItemToCloudWatchMessage(item) { | ||
key: 'formatLog', | ||
value: function formatLog(item) { | ||
var meta = (0, _lodash2.default)(item.meta) ? '' : ' ' + (0, _stringify2.default)(item.meta, null, 2); | ||
@@ -51,2 +61,2 @@ return '[' + item.level.toUpperCase() + '] ' + item.message + meta; | ||
exports.default = CloudWatchEventFormatter; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi9jbG91ZHdhdGNoLWV2ZW50LWZvcm1hdHRlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBRUE7Ozs7OztJQUVxQix3Qjs7Ozs7OztrQ0FDRyxJLEVBQU07QUFDMUIsYUFBTztBQUNMLGlCQUFTLHlCQUF5QiwyQkFBekIsQ0FBcUQsSUFBckQsQ0FESjtBQUVMLG1CQUFXLEtBQUs7QUFGWCxPQUFQO0FBSUQ7OztnREFFbUMsSSxFQUFNO0FBQ3hDLFVBQU0sT0FBTyxzQkFBUSxLQUFLLElBQWIsSUFBcUIsRUFBckIsR0FDVCxNQUFNLHlCQUFlLEtBQUssSUFBcEIsRUFBMEIsSUFBMUIsRUFBZ0MsQ0FBaEMsQ0FEVjtBQUVBLG1CQUFXLEtBQUssS0FBTCxDQUFXLFdBQVgsRUFBWCxVQUF3QyxLQUFLLE9BQTdDLEdBQXVELElBQXZEO0FBQ0Q7Ozs7O2tCQVprQix3QiIsImZpbGUiOiJsaWIvY2xvdWR3YXRjaC1ldmVudC1mb3JtYXR0ZXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcclxuXHJcbmltcG9ydCBpc0VtcHR5IGZyb20gJ2xvZGFzaC5pc2VtcHR5J1xyXG5cclxuZXhwb3J0IGR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clxuXHJcbiAgZm9ybWF0TG9nSXRlbSAoaXRlbSkge1xyXG4gICAgcmV0dXJuIHtcclxuICAgICAgbWVzc2FnZTogdGhpcy5mb3JtYXRMb2coaXRlbSksXHJcbiAgICAgIHRpbWVzdGFtcDogaXRlbS5kYXRlXHJcbiAgICB9XHJcbiAgfVxyXG5cclxuICBmb3JtYXRMb2cgKGl0ZW0pIHtcclxuICAgIGNvbnN0IG1ldGEgPSBpc0VtcHR5KGl0ZW0ubWV0YSkgPyAnJ1xyXG4gICAgICA6ICcgJyArIEpTT04uc3RyaW5naWZ5KGl0ZW0ubWV0YSwgbnVsbCwgMilcclxuICAgIHJldHVybiBgWyR7aXRlbS5sZXZlbC50b1VwcGVyQ2FzZSgpfV0gJHtpdGVtLm1lc3NhZ2V9JHttZXRhfWBcclxuICB9XHJcbn1cclxuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 |
{ | ||
"name": "winston-aws-cloudwatch", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "A Winston transport for Amazon CloudWatch.", | ||
@@ -56,3 +56,4 @@ "keywords": [ | ||
"sinon": "^1.17.4", | ||
"sinon-chai": "^2.8.0" | ||
"sinon-chai": "^2.8.0", | ||
"yargs": "^4.7.1" | ||
}, | ||
@@ -84,5 +85,6 @@ "main": "index.js", | ||
"beforeEach", | ||
"afterEach" | ||
"afterEach", | ||
"sinon" | ||
] | ||
} | ||
} |
@@ -23,3 +23,3 @@ # winston-aws-cloudwatch | ||
}, | ||
formatLogItem: function (item) { | ||
formatLog: function (item) { | ||
return item.level + ': ' + item.message + ' ' + JSON.stringify(item.meta) | ||
@@ -26,0 +26,0 @@ } |
43403
541
27