Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting crashes if it gets undefined for a JSON parameter #27

Closed
jsumners opened this issue Apr 11, 2016 · 2 comments
Closed

Formatting crashes if it gets undefined for a JSON parameter #27

jsumners opened this issue Apr 11, 2016 · 2 comments

Comments

@jsumners
Copy link
Member

pino.info('some %s: %j', 'object', undefined); // go boom

2016-04-11_14-46-41

This occurs in a rather special situation in my application, but it seems to me like this is something logger should handle gracefully.

@davidmarkclements
Copy link
Member

fix published as minor patch to quick-format - thanks @jsumners! (just reinstall and all should be well)

just for reference:

pino.info('%d', undefined) will be '%d'
pino.info('%s', undefined) will be 'undefined'
pino.info('%j', undefined) will be '%j'
pino.info('%d', null) will be '%d'
pino.info('%s', null) will be 'null'
pino.info('%j', null) will be 'null'

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants