★ wanayoo — archive 1999 https://github.com/ev3dev-lang-java/ev3dev-lang-java/issues/759Nouvelle recherche | Portail wanayoo
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

Lazy Logging With Lambda Expressions #759

Open
jabrena opened this issue Dec 27, 2020 · 0 comments
Open

Lazy Logging With Lambda Expressions #759

jabrena opened this issue Dec 27, 2020 · 0 comments
Assignees
Milestone

Comments

@jabrena
Copy link
Member

@jabrena jabrena commented Dec 27, 2020

Refactor the code using this way to improve the readability of the classes:

From:

if (logger.isTraceEnabled()) {
    logger.trace("Number is {}", getRandomNumer());
}

To:

logger.trace("Number is {}", () -> getRandomNumber());

Reference:
https://www.baeldung.com/log4j-2-lazy-logging

@jabrena jabrena self-assigned this Dec 27, 2020
@jabrena jabrena added this to the v1.0.0 milestone Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.