All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.likethesalad.android.templates.common.utils.Logger.kt Maven / Gradle / Ivy

Go to download

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"
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy