I want to write a simple helper logging function in kotlin-js, like so:
inline fun log(block: () -> String){
kotlin.js.console.log("[LOG] ${block()}")
}
But when using it like log{ "Processing..." }
, the console still prints the line where the function log
body is defined, not where it is called (which inlining should be doing).
Any ways to achieve the proper line output?