Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't throw error when passed circular structure as meta #331

Closed
gr2m opened this issue Nov 29, 2013 · 4 comments
Closed

Doesn't throw error when passed circular structure as meta #331

gr2m opened this issue Nov 29, 2013 · 4 comments

Comments

@gr2m
Copy link

gr2m commented Nov 29, 2013

hope that makes sense?

winston = require('winston')
winston.add(winston.transports.File, { filename: './app.log' });

// script just stops here, silently, no error message
// When I stop the script, it's still running in the background and eating up all my CPU / memory
winston.error("bla bla", getCircularStructur())

If I do the same with a JSON.stringify, it throws the error:

console.error(JSON.stringify(getCircularStructur()))
@shaharke
Copy link

+1

A more common use-case is when one passes and Error object as metadata.

@indexzero
Copy link
Member

This needs investigation and probably better test coverage. If anything it is a bug in cycle.decycle.

@DABH
Copy link
Contributor

DABH commented Apr 19, 2018

Closing, see #1248 , in winston@3 you can define custom formatters that do whatever you like with your data -- e.g. managing decycling behavior for circular objects.

@DABH DABH closed this as completed Apr 19, 2018
@indexzero
Copy link
Member

FYI circular JSON is supported by default thanks to winstonjs/logform#35

@winstonjs winstonjs locked as resolved and limited conversation to collaborators Jun 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants