-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Deep merge meta objects #1885
Deep merge meta objects #1885
Conversation
I'd like to request a second, optional param added to child(defaultRequestMetadata, customizer = undefined) {
const logger = this;
return Object.create(logger, {
write: {
value: function (info) {
const infoClone = mergeWith(
{},
defaultRequestMetadata,
info,
customizer
);
// Object.assign doesn't copy inherited Error
// properties so we have to do that explicitly
//
// Remark (indexzero): we should remove this
// since the errors format will handle this case.
//
if (info instanceof Error) {
infoClone.stack = info.stack;
infoClone.message = info.message;
}
logger.write(infoClone);
}
}
});
} |
+1 |
This sounds like a no-brainer. Does any maintainer have any bandwidth for this? |
@JaneJeon I ended up forking and implementing my example if you want to use it https://github.com/FoxxMD/winston/tree/feature/deep-merge-meta-object |
@FoxxMD Would you be willing to create a Feature Request for this? It's related but we shouldn't be introducing new functionality in a Bugfix PR. |
@maverick1872 absolutely. Should I wait until #1989 is merged/finalized before opening a PR? |
Since they're unrelated no need to wait. Although I will ask if you can give me a day or two prior to creating it. I'm working on introducing some changes to our issue/feature templates to hopefully help with some housekeeping moving forward. |
@FoxxMD Issue templates updated - feel free to create feature request whenever. |
Tested your implementation against the new test cases I've developed in #1989. 10 of them are failing so I think it best to close this PR for an alternative implementation. Additionally I'm not a huge fan of introducing new dependencies unless absolutely required. |
Change meta merge from Object.assign to lodash merge to allow deep merge of meta objects
Closes #1884