pinojs / quick-format-unescaped

Solves a problem with util.format
MIT License
17 stars 13 forks source link

v4 won't print objects unless format string is present #39

Open mhamann opened 3 years ago

mhamann commented 3 years ago

I recently upgraded to the latest version of pinojs, which pulls in this library. In the previous version of pino, I could do something like this:

log.info('Uhoh, an error occurred:', err);
--or--
log.info('This object was just received', { some: 'object', with: 'values' });

Which would print the string + the provided object/arguments.

I see that in quick-format-unescaped v4, this was changed to not work without using the format: log.info('This object was just received %s, { some: 'object', with: 'values' });, which ends up breaking a lot of logging code that I had.

@davidmarkclements could you elaborate what the purpose was for this change? (i.e. https://github.com/davidmarkclements/quick-format-unescaped/commit/71130104d712854d4e4f080a4da038ec02573432)

Or, is there some workaround?