You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Logging a variable with a circular reference causes an unhandled exception.
What do you expect to happen instead?
I would expect the exception would be caught and a warning message printed. Or the circular reference would be noted in the resulting JSON, like util.inspect does. Something like: https://www.npmjs.com/package/circular-json
/app/node_modules/logform/json.js:23
info[MESSAGE] = JSON.stringify(info, opts.replacer || replacer, opts.space);
^
TypeError: Converting circular structure to JSON
at JSON.stringify (<anonymous>)
at Format.module.exports.format [as transform] (/app/node_modules/logform/json.js:23:24)
at Format.info [as transform] (/app/node_modules/logform/combine.js:20:24)
at DerivedLogger._transform (/app/node_modules/winston/lib/winston/logger.js:220:27)
at DerivedLogger.Transform._read (_stream_transform.js:190:10)
at DerivedLogger.Transform._write (_stream_transform.js:178:12)
at doWrite (_stream_writable.js:413:12)
at writeOrBuffer (_stream_writable.js:397:5)
at DerivedLogger.Writable.write (_stream_writable.js:295:11)
at DerivedLogger.log (/app/node_modules/winston/lib/winston/logger.js:176:10)
The text was updated successfully, but these errors were encountered:
Please tell us about your environment:
winston
version?_winston@2
[email protected]
node -v
outputs: v10.1.0What is the problem?
Logging a variable with a circular reference causes an unhandled exception.
What do you expect to happen instead?
I would expect the exception would be caught and a warning message printed. Or the circular reference would be noted in the resulting JSON, like util.inspect does. Something like:
https://www.npmjs.com/package/circular-json
Other information
Here is the code:
Error Message:
The text was updated successfully, but these errors were encountered: