Closed BD103 closed 1 month ago
A lot of functions in Logging only do something if RobotConfig.debug = true:
Logging
RobotConfig.debug = true
fun write(...) { if (RobotConfig.debug) { // ... } }
This can be substituted for a shortcut function that takes a function as a receiver:
fun write(...) = ifDebug { // ... }
This can work through Kotlin's trailing functions, where can desugar myFunction { ... } into myFunction({ ... }).
myFunction { ... }
myFunction({ ... })
A lot of functions in
Logging
only do something ifRobotConfig.debug = true
:This can be substituted for a shortcut function that takes a function as a receiver:
This can work through Kotlin's trailing functions, where can desugar
myFunction { ... }
intomyFunction({ ... })
.