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

add new streamWrite hook #2105

Merged
merged 3 commits into from
Dec 14, 2024
Merged

add new streamWrite hook #2105

merged 3 commits into from
Dec 14, 2024

Conversation

theoephraim
Copy link
Contributor

This PR adds a new streamWrite hook which is able to modify the final stringified log just before it written to a transport (stream).

The use case here is to allow a user (or plugin author like myself) to scrub known sensitive secrets from logs before they are sent out to various transports, regardless of how these values ended up there (see #2102)

I played around with injecting a hook in a few different places but this seemed like the simplest and best place for it to go. Obviously could add more checks / tests / etc, but overall seems fairly simple.

Please let me know if you have any concerns or anything else you would like to see.

@jsumners
Copy link
Member

@mcollina I don't have a dedicated system I can run the benchmarks on. Can you run them? The CI results are too variable to be of much use.

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

I'm not seeing any regressions

pino.d.ts Show resolved Hide resolved
@theoephraim
Copy link
Contributor Author

appears to be an unrelated intermittent test failure?

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

@mcollina mcollina merged commit bb1f89d into pinojs:main Dec 14, 2024
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants