winston-cloudwatch
Advanced tools
Comparing version
@@ -0,1 +1,5 @@ | ||
### 2.0.3 | ||
stringify supports circular references | ||
### 2.0.2 | ||
@@ -2,0 +6,0 @@ |
var chalk = require('chalk'); | ||
var safeStringify = require('fast-safe-stringify') | ||
@@ -12,4 +13,5 @@ function handleErrorObject(key, value) { | ||
} | ||
function stringify(o) { return JSON.stringify(o, handleErrorObject, ' '); } | ||
function stringify(o) { return safeStringify(o, handleErrorObject, ' '); } | ||
function debug() { | ||
@@ -16,0 +18,0 @@ if (!process.env.WINSTON_CLOUDWATCH_DEBUG) return; |
{ | ||
"name": "winston-cloudwatch", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Send logs to Amazon Cloudwatch using Winston.", | ||
@@ -29,2 +29,3 @@ "keywords": [ | ||
"chalk": "^2.4.1", | ||
"fast-safe-stringify": "^2.0.6", | ||
"lodash.assign": "^4.2.0", | ||
@@ -31,0 +32,0 @@ "lodash.find": "^4.6.0", |
@@ -1,2 +0,2 @@ | ||
# winston-cloudwatch [v2.0.2](https://github.com/lazywithclass/winston-cloudwatch/blob/master/CHANGELOG.md#200) | ||
# winston-cloudwatch [v2.0.3](https://github.com/lazywithclass/winston-cloudwatch/blob/master/CHANGELOG.md#203) | ||
@@ -70,6 +70,15 @@ [](https://travis-ci.org/lazywithclass/winston-cloudwatch) [](https://coveralls.io/github/lazywithclass/winston-cloudwatch?branch=master) [](https://david-dm.org/lazywithclass/winston-cloudwatch) [](https://david-dm.org/lazywithclass/winston-cloudwatch#info=devDependencies) [](https://david-dm.org/lazywithclass/winston-cloudwatch#info=peerDependencies) | ||
In ES5 | ||
```js | ||
var winston = require('winston'), | ||
WinstonCloudWatch = require('../index'); | ||
WinstonCloudWatch = require('winston-cloudwatch'); | ||
``` | ||
In ES6 | ||
```js | ||
import winston from 'winston'; | ||
import WinstonCloudWatch from 'winston-cloudwatch'; | ||
``` | ||
```js | ||
winston.add(new WinstonCloudWatch({ | ||
@@ -76,0 +85,0 @@ logGroupName: 'testing', |
@@ -1,8 +0,8 @@ | ||
describe('utils', function() { | ||
describe('utils', function () { | ||
describe('stringify', function() { | ||
describe('stringify', function () { | ||
const lib = require('../lib/utils') | ||
it('stringifies an object', function() { | ||
it('stringifies an object', function () { | ||
const object = { answer: 42 } | ||
@@ -12,5 +12,5 @@ lib.stringify(object).should.equal(JSON.stringify(object, null, ' ')) | ||
it('stringifies an Error istance', function() { | ||
it('stringifies an Error istance', function () { | ||
const error = new Error('uh-oh'), | ||
result = JSON.parse(lib.stringify(error)) | ||
result = JSON.parse(lib.stringify(error)) | ||
result.message.should.equal('uh-oh') | ||
@@ -20,2 +20,13 @@ result.stack.should.be.an.instanceOf(String) | ||
it('handles circular objects', function () { | ||
const circular = {} | ||
const child = { circular } | ||
circular.child = child | ||
const stringify = () => { | ||
lib.stringify(circular) | ||
} | ||
stringify.should.not.throw() | ||
}) | ||
}) | ||
@@ -22,0 +33,0 @@ |
56434
0.53%1181
0.25%158
6.04%10
11.11%24
-4%+ Added
+ Added