From bf4217ea6150c5404a771e05d5490ee99115b9c7 Mon Sep 17 00:00:00 2001 From: rnentjes Date: Sun, 27 Oct 2024 15:35:29 +0100 Subject: [PATCH] Fix caller stack trace depth and update version Adjusted the caller stack trace depth to accurately capture the caller method. Updated Gradle build version from 1.1.0 to 1.1.1 to reflect the changes. Improved logging level representation by using 'label' instead of 'name'. --- build.gradle.kts | 2 +- src/commonMain/kotlin/nl/astraeus/logger/Logger.kt | 2 +- src/jvmMain/kotlin/nl/astraeus/logger/Logger.jvm.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 210fed8..63c56f3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ plugins { } group = "nl.astraeus" -version = "1.1.0" +version = "1.1.1" repositories { mavenCentral() diff --git a/src/commonMain/kotlin/nl/astraeus/logger/Logger.kt b/src/commonMain/kotlin/nl/astraeus/logger/Logger.kt index 5f6d01a..f997463 100644 --- a/src/commonMain/kotlin/nl/astraeus/logger/Logger.kt +++ b/src/commonMain/kotlin/nl/astraeus/logger/Logger.kt @@ -55,7 +55,7 @@ class Logger( } logEntry.append(timestamp) logEntry.append(" - ") - logEntry.append(level.name) + logEntry.append(level.label) logEntry.append(" - ") if (thread != null) { logEntry.append(thread) diff --git a/src/jvmMain/kotlin/nl/astraeus/logger/Logger.jvm.kt b/src/jvmMain/kotlin/nl/astraeus/logger/Logger.jvm.kt index 6683197..89354fb 100644 --- a/src/jvmMain/kotlin/nl/astraeus/logger/Logger.jvm.kt +++ b/src/jvmMain/kotlin/nl/astraeus/logger/Logger.jvm.kt @@ -6,4 +6,4 @@ actual fun getTimestamp(): String = Date().toString() actual fun getCurrentThread(): String? = Thread.currentThread().name -actual fun getCaller(): String? = Throwable().stackTrace[2].toString() \ No newline at end of file +actual fun getCaller(): String? = Throwable().stackTrace[3].toString() \ No newline at end of file