pn-lambda-logger
Advanced tools
Comparing version
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const chalk_1 = require("chalk"); | ||
const safeStringify = require("json-stringify-safe"); | ||
const util_1 = require("util"); | ||
@@ -35,3 +36,10 @@ const inspectOptions = { | ||
// Regular JSON output | ||
return JSON.stringify(logOutput, null, 2); | ||
try { | ||
// Try using native stringify - fast | ||
return JSON.stringify(logOutput, null, 2); | ||
} | ||
catch (_a) { | ||
// Use safe parser if it throws - slower, but handles circular references | ||
return safeStringify(logOutput, null, 2); | ||
} | ||
} | ||
@@ -38,0 +46,0 @@ } |
{ | ||
"name": "pn-lambda-logger", | ||
"version": "0.12.0", | ||
"version": "0.13.0", | ||
"description": "Logger for AWS Lambda nodejs.", | ||
@@ -22,3 +22,4 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"chalk": "^2.4.2" | ||
"chalk": "^2.4.2", | ||
"json-stringify-safe": "^5.0.1" | ||
}, | ||
@@ -31,2 +32,3 @@ "devDependencies": { | ||
"@types/common-tags": "^1.8.0", | ||
"@types/json-stringify-safe": "^5.0.0", | ||
"@types/mocha": "5.2.5", | ||
@@ -33,0 +35,0 @@ "@types/node": "10.11.2", |
@@ -152,7 +152,9 @@ # A nodejs logger for AWS Lambda | ||
`"version": "0.11.0",` to `"version": "0.12.0"` | ||
``` | ||
"version": "0.11.0",` to `"version": "0.12.0" | ||
``` | ||
2. Make a commit titled "Release `version`": | ||
```bash | ||
``` | ||
git commit -m "Release 0.12.0" | ||
@@ -164,3 +166,3 @@ ``` | ||
```bash | ||
``` | ||
git tag -a "release-0.12.0" -m "Release 0.12.0" | ||
@@ -171,4 +173,4 @@ ``` | ||
```bash | ||
``` | ||
git push --follow-tags | ||
``` |
Sorry, the diff of this file is not supported yet
31615
1.65%503
1.62%174
1.16%2
100%17
6.25%+ Added
+ Added