Reuse build configuration for logger
This commit is contained in:
@@ -9,6 +9,8 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":architecture"))
|
||||
|
||||
implementation(libs.google.dagger.hiltAndroid)
|
||||
kapt(libs.google.dagger.hiltCompiler)
|
||||
}
|
||||
@@ -1,13 +1,17 @@
|
||||
package gq.kirmanak.mealient.logging
|
||||
|
||||
import android.util.Log
|
||||
import gq.kirmanak.mealient.architecture.configuration.BuildConfiguration
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class LogcatAppender @Inject constructor() : Appender {
|
||||
class LogcatAppender @Inject constructor(
|
||||
private val buildConfiguration: BuildConfiguration,
|
||||
) : Appender {
|
||||
|
||||
private val isLoggable: Boolean by lazy { BuildConfig.DEBUG }
|
||||
private val isLoggable: Boolean
|
||||
get() = buildConfiguration.isDebug()
|
||||
|
||||
override fun isLoggable(logLevel: LogLevel): Boolean = isLoggable
|
||||
|
||||
|
||||
Reference in New Issue
Block a user