christophsturm
09/22/2022, 6:48 AMlog("going to work in items ${items.map {it.id}}")
maybe a way to append directly to the string buffer instead of creating an array.thanksforallthefish
09/22/2022, 7:00 AMjoinToString
and prefix
but it is just a hunch, never measuredchristophsturm
09/22/2022, 7:24 AMitems.joinToString(prefix = "going to work on items (", postfix = ")") { it.id.toString() }
christophsturm
09/22/2022, 7:26 AMthanksforallthefish
09/22/2022, 7:27 AMthanksforallthefish
09/22/2022, 7:27 AMchristophsturm
09/22/2022, 7:27 AMKlitos Kyriacou
09/22/2022, 8:12 AMlogger.debug { items.joinToString(prefix = "going to work on items (", postfix = ")") { it.id.toString() } }
If you're using a logging framework that already supports lambdas (such as log4j 2 or java.util.logging) you can use that directly.christophsturm
09/22/2022, 8:15 AM