debug
debug copied to clipboard
fix(common): escape replaced value
Something like this log('I like %O', { name: '%sugar%' });
will cause output incorrect.
Coverage increased (+0.05%) to 87.739% when pulling d68754267e072bf1039772a1a28714cf0a200b04 on blastZ:patch-1 into 80ef62a3af4df95250d77d64edfc3d0e1667e7e8 on visionmedia:master.
Coverage increased (+0.05%) to 87.739% when pulling d68754267e072bf1039772a1a28714cf0a200b04 on blastZ:patch-1 into 80ef62a3af4df95250d77d64edfc3d0e1667e7e8 on visionmedia:master.
Can you add tests for this, please? I'm not sure which sorts of things this fixes.
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.