Skip to content

Deep copy msg object (fix the issue: logger.info({message:...}) modifies original object)#2473

Open
Bhavesh-Parmar wants to merge 1 commit intowinstonjs:masterfrom
Bhavesh-Parmar:patch-1
Open

Deep copy msg object (fix the issue: logger.info({message:...}) modifies original object)#2473
Bhavesh-Parmar wants to merge 1 commit intowinstonjs:masterfrom
Bhavesh-Parmar:patch-1

Conversation

@Bhavesh-Parmar
Copy link
Copy Markdown

@Bhavesh-Parmar Bhavesh-Parmar commented Jun 8, 2024

Fixing the belwo issue( resolves #1775) by deep copy the message

const data = {'message':'hello'}
logger.log(data)
// now data contains "level":"info"

@Bhavesh-Parmar Bhavesh-Parmar marked this pull request as draft June 8, 2024 07:19
@Bhavesh-Parmar Bhavesh-Parmar marked this pull request as ready for review June 8, 2024 07:21
Copy link
Copy Markdown

@MrSuddenJoy MrSuddenJoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code looks good to me. Well done 👍🏻

@olehakon
Copy link
Copy Markdown

@Bhavesh-Parmar When will this fix be merged?

@Bhavesh-Parmar
Copy link
Copy Markdown
Author

This code looks good to me. Well done 👍🏻

Thank you @MrSuddenJoy.

@Bhavesh-Parmar
Copy link
Copy Markdown
Author

@Bhavesh-Parmar When will this fix be merged?

@olehakon really I don't know when it will be merged.

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

Successfully merging this pull request may close these issues.

logger.info({message:...}) modifies original object

3 participants