Skip to content

chore: Conditionally require pino if logger is enabled#5763

Merged
jsumners merged 23 commits into
fastify:mainfrom
karankraina:conditional-pino-ajv
Oct 27, 2024
Merged

chore: Conditionally require pino if logger is enabled#5763
jsumners merged 23 commits into
fastify:mainfrom
karankraina:conditional-pino-ajv

Conversation

@karankraina

@karankraina karankraina commented Oct 23, 2024

Copy link
Copy Markdown
Contributor

Checklist

Ref #5507

@dancastillo dancastillo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add tests

@karankraina

Copy link
Copy Markdown
Contributor Author

@dancastillo Added tests

@metcoder95 metcoder95 changed the title Conditionally require pino if logger is enabled chore: Conditionally require pino if logger is enabled Oct 24, 2024
Comment thread test/conditional-pino.test.js Outdated
Comment thread lib/logger-utils.js Outdated
Comment thread lib/logger-utils.js Outdated
Co-authored-by: Manuel Spigolon <behemoth89@gmail.com>
Signed-off-by: Karan Raina <karanraina1996@gmail.com>
Comment thread fastify.js Outdated

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@karankraina

Copy link
Copy Markdown
Contributor Author

@mcollina @Eomm @metcoder95 An unrelated test is failing. Anyone has any idea?

@karankraina

Copy link
Copy Markdown
Contributor Author

@mcollina @metcoder95 @Eomm I think I found it. It was due this race between 2 sget that made this unpredictable. Updated PR. Tests should pass now :)

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@karankraina

Copy link
Copy Markdown
Contributor Author

Looks like @smartinio already fixed the flaky test on main. Rebased my branch and reverted my changes.
@mcollina Please retrigger checks.

Comment thread lib/fourOhFour.js Outdated
Comment thread lib/logger-factory.js Outdated
Comment thread lib/logger-utils.js Outdated
Comment thread lib/logger-utils.js Outdated
Comment thread fastify.js Outdated
karankraina and others added 4 commits October 24, 2024 23:45
Co-authored-by: Manuel Spigolon <behemoth89@gmail.com>
Signed-off-by: Karan Raina <karanraina1996@gmail.com>
Co-authored-by: Manuel Spigolon <behemoth89@gmail.com>
Signed-off-by: Karan Raina <karanraina1996@gmail.com>
Co-authored-by: Manuel Spigolon <behemoth89@gmail.com>
Signed-off-by: Karan Raina <karanraina1996@gmail.com>

@metcoder95 metcoder95 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm, please address @Eomm suggestion

@karankraina

Copy link
Copy Markdown
Contributor Author

@Eomm Have done the refactor as per your suggestions. Let me know what you think about this.

Comment thread lib/logger-factory.js Outdated
Comment thread lib/logger-factory.js
Comment thread lib/logger-factory.js Outdated
Comment thread lib/logger-utils.js Outdated
Comment thread test/conditional-pino.test.js Outdated
Co-authored-by: James Sumners <321201+jsumners@users.noreply.github.com>
Signed-off-by: Karan Raina <karanraina1996@gmail.com>

@Eomm Eomm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this PR is quite ready! We need just to clean up the code from old trials.

Good work!

Comment thread lib/logger-utils.js Outdated
@karankraina karankraina requested a review from jsumners October 26, 2024 11:17
Comment thread lib/logger-factory.js Outdated
Comment thread test/conditional-pino.test.js Outdated
Comment thread test/conditional-pino.test.js Outdated
karankraina and others added 3 commits October 26, 2024 20:21
Co-authored-by: James Sumners <321201+jsumners@users.noreply.github.com>
Signed-off-by: Karan Raina <karanraina1996@gmail.com>
@karankraina karankraina requested a review from jsumners October 26, 2024 14:54
Comment thread test/conditional-pino.test.js Outdated
@karankraina karankraina requested a review from jsumners October 26, 2024 18:31
@karankraina

Copy link
Copy Markdown
Contributor Author

@jsumners Is this ok to merge now?

@jsumners jsumners left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me.

@jsumners jsumners merged commit dead273 into fastify:main Oct 27, 2024
@Eomm Eomm added the performances Everything related to performances label Oct 31, 2024
@github-actions

github-actions Bot commented Nov 1, 2025

Copy link
Copy Markdown

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 Nov 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

performances Everything related to performances

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants