Skip to content

Commit 19fe8b9

Browse files
committed
use json-stringify-safe for circular-json errors
1 parent 14964f7 commit 19fe8b9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@
2323
"author": "LambdaTest <[email protected]>",
2424
"license": "MIT",
2525
"dependencies": {
26+
"@lambdatest/node-tunnel": "^4.0.9",
2627
"@playwright/browser-chromium": "^1.47.2",
2728
"@playwright/browser-firefox": "^1.47.2",
2829
"@playwright/browser-webkit": "^1.47.2",
2930
"@playwright/test": "^1.47.2",
3031
"@types/cross-spawn": "^6.0.4",
32+
"@types/json-stringify-safe": "^5.0.3",
3133
"@types/node": "^20.8.9",
3234
"@types/which": "^3.0.2",
33-
"@lambdatest/node-tunnel": "^4.0.9",
3435
"ajv": "^8.12.0",
3536
"ajv-errors": "^3.0.0",
3637
"axios": "^1.6.0",
@@ -39,6 +40,7 @@
3940
"cross-spawn": "^7.0.3",
4041
"fastify": "^4.24.3",
4142
"form-data": "^4.0.0",
43+
"json-stringify-safe": "^5.0.1",
4244
"listr2": "^7.0.1",
4345
"node-cache": "^5.1.2",
4446
"sharp": "^0.33.4",

src/lib/logger.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createLogger, format, transports, log } from 'winston'
2+
import stringify from 'json-stringify-safe'
23
import constants from './constants.js'
34
import { Env } from '../types.js'
45
import getEnv from './env.js'
@@ -26,7 +27,7 @@ const logger = createLogger({
2627
format.timestamp(),
2728
format.printf(info => {
2829
let contextString = Object.values(logContext).join(' | ');
29-
let message = (typeof info.message === 'object') ? JSON.stringify(info.message).trim() : info.message.trim();
30+
let message = (typeof info.message === 'object') ? stringify(info.message) : info.message.trim();
3031
switch (info.level) {
3132
case 'warn':
3233
message = chalk.yellow(message);

0 commit comments

Comments
 (0)