Skip to content

Conversation

JohannisK
Copy link
Contributor

What's changed?

Log statements calling methods to build their messages should be enclosed in an is<Level>Enabled() check.

@JohannisK JohannisK linked an issue Apr 23, 2025 that may be closed by this pull request
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Apr 23, 2025
@JohannisK JohannisK added the recipe Recipe Requested label Apr 23, 2025
@JohannisK JohannisK self-assigned this Apr 23, 2025
timtebeek and others added 6 commits April 23, 2025 14:26
…F4JLoggers.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…F4JLoggers.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…F4JLoggersTest.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…F4JLoggersTest.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…F4JLoggers.java

Co-authored-by: Tim te Beek <tim@moderne.io>
@timtebeek timtebeek marked this pull request as draft April 24, 2025 15:03
@timtebeek timtebeek changed the title WIP: Inexpensive Loggers Wrap logging statements with method invocation arguments in an if enabled conditional Apr 24, 2025
github-actions[bot]

This comment was marked as off-topic.

github-actions[bot]

This comment was marked as off-topic.

github-actions[bot]

This comment was marked as off-topic.

github-actions[bot]

This comment was marked as off-topic.

github-actions[bot]

This comment was marked as off-topic.

github-actions[bot]

This comment was marked as off-topic.

@JohannisK JohannisK marked this pull request as ready for review April 29, 2025 13:58
Copy link
Contributor

@greg-at-moderne greg-at-moderne left a comment

Choose a reason for hiding this comment

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

I need to admit the accumulator code is hardly readable for me. But as usual - I fail to have a better suggestion on how to approach this. Maybe we are lacking some utility method/class which would handle that more gracefully.

Having said that, the code LGTM. Good test coverage.

github-actions[bot]

This comment was marked as off-topic.

github-actions[bot]

This comment was marked as off-topic.

github-actions[bot]

This comment was marked as off-topic.

@JohannisK JohannisK merged commit 5d1b4cd into main Apr 30, 2025
2 checks passed
@JohannisK JohannisK deleted the 81-recipe-to-put-expensive-logger-parameters-into-lambdasconditionals branch April 30, 2025 09:55
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
recipe Recipe Requested
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Recipe to put expensive logger parameters into lambdas/conditionals
3 participants