https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
z

Zsolt Bencze

11/02/2023, 9:57 AM
Any way to improve this call site? (is intended to be lazy loaded for logging - based on severity some might not get evaluated at all)
Copy code
log.error(e, { "Error logging in user" }, { mapOf("email" to email) })
In Swift you have the option to use
@autoclosure: () -> String
and then the call site is
someFunc("mylog")
Is there anything like that for Kotlin?
e

Edoardo Luppi

11/02/2023, 3:25 PM
Not that I know of.
Compiler plugin could make it happen I guess.
👀 1