From 9c38c49195dfe9672ff6690b29f13c13e919fd01 Mon Sep 17 00:00:00 2001 From: Ohad Shai Date: Mon, 24 Jul 2023 09:17:33 +0300 Subject: [PATCH] fix deprecated "replaceWith" directive (#340) --- .../io/github/oshai/kotlinlogging/KLogger.kt | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/commonMain/kotlin/io/github/oshai/kotlinlogging/KLogger.kt b/src/commonMain/kotlin/io/github/oshai/kotlinlogging/KLogger.kt index d8009c61..2bce707f 100644 --- a/src/commonMain/kotlin/io/github/oshai/kotlinlogging/KLogger.kt +++ b/src/commonMain/kotlin/io/github/oshai/kotlinlogging/KLogger.kt @@ -253,27 +253,27 @@ public interface KLogger { @Deprecated("use error instead", ReplaceWith("error(t, marker, msg)")) public fun error(marker: Marker?, t: Throwable?, msg: () -> Any?): Unit = error(t, marker, msg) - @Deprecated("Use isTraceEnabled instead", ReplaceWith("isTraceEnabled")) + @Deprecated("Use isTraceEnabled() instead", ReplaceWith("isTraceEnabled()")) public val isTraceEnabled: Boolean get() = isTraceEnabled() - @Deprecated("Use isDebugEnabled instead", ReplaceWith("isDebugEnabled")) + @Deprecated("Use isDebugEnabled() instead", ReplaceWith("isDebugEnabled()")) public val isDebugEnabled: Boolean get() = isDebugEnabled() - @Deprecated("Use isInfoEnabled instead", ReplaceWith("isInfoEnabled")) + @Deprecated("Use isInfoEnabled() instead", ReplaceWith("isInfoEnabled()")) public val isInfoEnabled: Boolean get() = isInfoEnabled() - @Deprecated("Use isWarnEnabled instead", ReplaceWith("isWarnEnabled")) + @Deprecated("Use isWarnEnabled() instead", ReplaceWith("isWarnEnabled()")) public val isWarnEnabled: Boolean get() = isWarnEnabled() - @Deprecated("Use isErrorEnabled instead", ReplaceWith("isErrorEnabled")) + @Deprecated("Use isErrorEnabled() instead", ReplaceWith("isErrorEnabled()")) public val isErrorEnabled: Boolean get() = isErrorEnabled() - @Deprecated("Use isLoggingOff instead", ReplaceWith("isLoggingOff")) + @Deprecated("Use isLoggingOff() instead", ReplaceWith("isLoggingOff()")) public val isLoggingOff: Boolean get() = isLoggingOff() @@ -398,7 +398,7 @@ public interface KLogger { * * @param msg the message string to be logged */ - @Deprecated("Use debug {} instead", replaceWith = ReplaceWith("debug { \"\$msg\"}")) + @Deprecated("Use debug {} instead", replaceWith = ReplaceWith("debug { msg }")) public fun debug(msg: String?): Unit = debug { msg } /** @@ -514,7 +514,8 @@ public interface KLogger { * * @param msg the message string to be logged */ - @Deprecated("Use info {} instead") public fun info(msg: String?): Unit = info { msg } + @Deprecated("Use info {} instead", ReplaceWith("info { msg }")) + public fun info(msg: String?): Unit = info { msg } /** * Log a message at the INFO level according to the specified msg and argument. @@ -628,7 +629,8 @@ public interface KLogger { * * @param msg the message string to be logged */ - @Deprecated("Use warn {} instead") public fun warn(msg: String?): Unit = warn { msg } + @Deprecated("Use warn {} instead", ReplaceWith("warn { msg }")) + public fun warn(msg: String?): Unit = warn { msg } /** * Log a message at the WARN level according to the specified msg and argument. @@ -742,7 +744,7 @@ public interface KLogger { * * @param msg the message string to be logged */ - @Deprecated("Use error {} instead", replaceWith = ReplaceWith("error { \"\$msg\"}")) + @Deprecated("Use error {} instead", replaceWith = ReplaceWith("error { msg }")) public fun error(msg: String?): Unit = error { msg } /**