Skip to content

Commit

Permalink
Fixing warning level + log replaced by display
Browse files Browse the repository at this point in the history
  • Loading branch information
quentin7b committed Jan 4, 2024
2 parents 71a018f + 089743d commit 38dad51
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.7.10'
ext.koin_version = '3.2.1'
ext.kotlin_version = '1.9.21'
ext.koin_version = '3.5.3'
ext.timber_version = '5.0.1'
repositories {
google()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class TimberLogger(
private val showDebug: Boolean = true,
private val showInfo: Boolean = true,
private val showErr: Boolean = true,
private val showWarning: Boolean = true,
tag: String? = null
) : Logger() {

Expand All @@ -42,14 +43,22 @@ class TimberLogger(
}
}

override fun log(level: Level, msg: MESSAGE) {
private fun showWarning(msg: String) {
if (showWarning) {
tree.w(msg)
}
}

override fun display(level: Level, msg: MESSAGE) {
when (level) {
Level.INFO -> showInfo(msg)
Level.WARNING -> showWarning(msg)
Level.DEBUG -> showDebug(msg)
Level.ERROR -> showErr(msg)
Level.NONE -> {
// Show nothing
}
}
}
}

}

0 comments on commit 38dad51

Please sign in to comment.