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
Inline log function with message lambda #1271
Conversation
what about perf impact? I'm always worried about impact as such level |
Sorry for late reply. What do you mean about performance impact? Less object will be created, which will have a positive effect on performance, especially considering that logging is called quite often. |
Need to check in our latest version of Kotlin, but string evaluation could be done even if the string is in a lambda: like |
Didn’t change anything, forgot that I already have 2 branches with pull requests. |
why this PR is still not merged? what does stop this? |
It's planned for |
Log API has been revamped https://github.com/InsertKoinIO/koin/blob/core/3.3.0/core/koin-core/src/commonMain/kotlin/org/koin/core/logger/Logger.kt Thanks for your proposal. Feel free to reopen discussion on new API |
Minor improvement.
When calling
log(level: Level, msg: () -> MESSAGE)
function with an inline modifier, no lambda object is created. This will slightly improve performance.I also removed canLog(...) function, because it is completely similar to the isAt(...) function.