pino
pino copied to clipboard
Drop support for printf style logging because once again i deployed logger.info(msg, obj) instead of logger.info(obj, msg) to prod and cant debug prod.
Would you accept a pull request for a breaking change where we drop varags on the LogFn and do not support printf style logging.
// this is fine
logger.info('a message')
// this is good. I wont bike shed about how the arguments should be swapped like bunyan and the rest.
logger.info({
something: 'happened'
}, 'a more descriptive image.
// This is horrible.
logger.info('oh hi %s', 'bye')
The issue I'm running into is that when I do the following
logger.info('a msg', { ... })
it's not a typescript error, because its technically an invalid printf expression and the vargs of ...any[] in the type signature makes the pino api basically untyped.
I want to make it harder for me to deploy broken log statements to prod when i swapped the arguments by accident and didnt catch it in review.
I'm happy to do the pull request, and of course it would be a major version.