I wrote a little post in an internal blog explaini...
# announcements
d
I wrote a little post in an internal blog explaining precisely that, and using it for a sample of 'GDPR friendly logging'
Copy code
const val logEnabled = true

inline fun logD(messageGenerator: () -> String) {
    if (logEnabled) {
        Log.d(messageGenerator())
    }
}
// Sample usage
fun functionWithLogs() {
    logD { "Message unnecessary in production" }
}
🆒 1