com.likethesalad.android.templates.common.utils.Logger.kt Maven / Gradle / Ivy
package com.likethesalad.android.templates.common.utils
class Logger private constructor(
private val gradleLogger: org.gradle.api.logging.Logger,
private val hostClass: Class
) {
companion object {
private var gradleLogger: org.gradle.api.logging.Logger? = null
fun init(gradleLogger: org.gradle.api.logging.Logger) {
this.gradleLogger = gradleLogger
}
fun create(hostClass: Class): Logger {
return Logger(gradleLogger!!, hostClass)
}
}
private val prefix by lazy {
"[STEM] - ${hostClass.name} - "
}
fun debug(message: String, vararg args: Any) {
gradleLogger.debug(getIdentifiedMessage(message), *args)
}
private fun getIdentifiedMessage(message: String): String {
return "$prefix$message"
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy