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

Clear cached parsed chindings when they're changed with .setBindings #893

Merged
merged 1 commit into from
Aug 13, 2020

Conversation

okofish
Copy link
Contributor

@okofish okofish commented Aug 12, 2020

This fixes #890; see that issue for discussion.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

var pino = require(require.resolve('./../../../'))
var log = pino({ prettyPrint: true }).child({ foo: 123 })
log.info('before')
log.setBindings({ foo: 456, bar: 789 })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we really exposing this as a public API? Can we exercise the code path without using this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which function are you referring to, .setBindings()? The point of this PR is to make that method work correctly when a prettifier is in use.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setBindings is already exposed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see it in our docs -- https://getpino.io/#/docs/api

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it should be documented, anyway this PR does not add it.

Copy link
Member

@jsumners jsumners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcollina mcollina merged commit 62d5c6c into pinojs:master Aug 13, 2020
@github-actions
Copy link

github-actions bot commented Feb 2, 2022

This pull request 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 2, 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

Successfully merging this pull request may close these issues.

logger.setBindings() doesn't clear logger[Symbol(pino.parsedChindings)]
3 participants