From e5f9371e56e161002ab5d7d4be078d1052e9d07b Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 13 Feb 2022 22:59:43 +0100 Subject: [PATCH] Implemented printing at least exception --- .../kotlin/net/dankito/utils/multiplatform/log/LoggerBase.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/multiplatform-utils/src/commonMain/kotlin/net/dankito/utils/multiplatform/log/LoggerBase.kt b/multiplatform-utils/src/commonMain/kotlin/net/dankito/utils/multiplatform/log/LoggerBase.kt index f1440445..1c5143f0 100644 --- a/multiplatform-utils/src/commonMain/kotlin/net/dankito/utils/multiplatform/log/LoggerBase.kt +++ b/multiplatform-utils/src/commonMain/kotlin/net/dankito/utils/multiplatform/log/LoggerBase.kt @@ -95,6 +95,10 @@ abstract class LoggerBase( } open fun createMessage(exception: Throwable?, message: String, vararg arguments: Any): String { + if (exception != null) { + return "$message: $exception\n${exception.stackTraceToString()}" + } + return message // really, there's not String.format() ?! // TODO: add arguments and exception }