Skip to content

Conversation

blastZ
Copy link

@blastZ blastZ commented Jul 2, 2020

Something like this log('I like %O', { name: '%sugar%' }); will cause output incorrect.

Something like this `log('I like %O', { name: '%sugar%' });` will cause output incorrect.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 87.739% when pulling d687542 on blastZ:patch-1 into 80ef62a on visionmedia:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 87.739% when pulling d687542 on blastZ:patch-1 into 80ef62a on visionmedia:master.

@Qix-
Copy link
Member

Qix- commented Jul 2, 2020

Can you add tests for this, please? I'm not sure which sorts of things this fixes.

@blastZ
Copy link
Author

blastZ commented Jul 7, 2020

Can you add tests for this, please? I'm not sure which sorts of things this fixes.

The default formatters will replace %o and %O, so when arguments go to the log function, util.format will get arguments like this ["...'%sugar%'... }", '...']. So if you don't escape the % in the value, util.format will replace %s with the next argument. That's why issue #766 happend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants