Skip to content

Commit

Permalink
Fix varargs issue in Logger
Browse files Browse the repository at this point in the history
  • Loading branch information
weliem committed Jun 26, 2021
1 parent 5ee0d87 commit d629673
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions blessed/src/main/java/com/welie/blessed/Logger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ internal object Logger {
}

/** Log an verbose message with optional format args. */
fun v(tag: String, msg: String, vararg args: Any?) {
triggerLogger(Log.VERBOSE, tag, msg, args)
fun v(tag: String, msg: String, vararg args: Any) {
triggerLogger(Log.VERBOSE, tag, msg, *args)
}

/**
Expand All @@ -34,8 +34,8 @@ internal object Logger {
}

/** Log an debug message with optional format args. */
fun d(tag: String, msg: String, vararg args: Any?) {
triggerLogger(Log.DEBUG, tag, msg, args)
fun d(tag: String, msg: String, vararg args: Any) {
triggerLogger(Log.DEBUG, tag, msg, *args)
}

/**
Expand All @@ -50,8 +50,8 @@ internal object Logger {
}

/** Log an info message with optional format args. */
fun i(tag: String, msg: String, vararg args: Any?) {
triggerLogger(Log.INFO, tag, msg, args)
fun i(tag: String, msg: String, vararg args: Any) {
triggerLogger(Log.INFO, tag, msg, *args)
}

/**
Expand All @@ -66,8 +66,8 @@ internal object Logger {
}

/** Log an warn message with optional format args. */
fun w(tag: String, msg: String, vararg args: Any?) {
triggerLogger(Log.WARN, tag, msg, args)
fun w(tag: String, msg: String, vararg args: Any) {
triggerLogger(Log.WARN, tag, msg, *args)
}

/**
Expand All @@ -82,8 +82,8 @@ internal object Logger {
}

/** Log an error message with optional format args. */
fun e(tag: String, msg: String, vararg args: Any?) {
triggerLogger(Log.ERROR, tag, msg, args)
fun e(tag: String, msg: String, vararg args: Any) {
triggerLogger(Log.ERROR, tag, msg, *args)
}

/**
Expand All @@ -97,8 +97,8 @@ internal object Logger {
}

/** Log an wtf message with optional format args. */
fun wtf(tag: String, msg: String, vararg args: Any?) {
triggerLogger(Log.ASSERT, tag, msg, args)
fun wtf(tag: String, msg: String, vararg args: Any) {
triggerLogger(Log.ASSERT, tag, msg, *args)
}

private fun triggerLogger(priority: Int, tag: String, msg: String, vararg args: Any) {
Expand Down
2 changes: 1 addition & 1 deletion 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.5.10'
ext.kotlin_version = '1.5.20'
repositories {
google()
mavenCentral()
Expand Down

0 comments on commit d629673

Please sign in to comment.