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

unable to reuse configuration object #10

Closed
ferrao opened this issue Dec 17, 2016 · 1 comment
Closed

unable to reuse configuration object #10

ferrao opened this issue Dec 17, 2016 · 1 comment
Assignees

Comments

@ferrao
Copy link

ferrao commented Dec 17, 2016

If i create a config object like this:

var config = {
    size: '10M',
    interval: '30s',
    rotate: 5
};

and reuse it on two calls to rotating-file-stream, the second call will fail with:

Error: Don't know how to handle 'options.size' type: number

The type number seems to come from expanding the original object from 10M to 10485760.

My workaround is to create a new object with exact same properties on each call to rotating-file-stream, but in my opinion, it should be up to the module to clone it and not impose this non documented restriction on the user.

@iccicci
Copy link
Owner

iccicci commented Dec 18, 2016

Yes it's true, the module destroys tho options object in input.

Going to fix this; in the mean while please use two different equivalent objects.

@iccicci iccicci self-assigned this Dec 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants