com.likethesalad.android.templates.common.utils.Logger.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of common-tools Show documentation
Show all versions of common-tools Show documentation
This is a Gradle plugin for Android applications which resolves XML string references in other XML strings.
The newest version!
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"
}
}