diff --git a/logging/src/main/kotlin/de/staropensource/engine/logging/Logger.kt b/logging/src/main/kotlin/de/staropensource/engine/logging/Logger.kt index c1e5173..d8b1ce8 100644 --- a/logging/src/main/kotlin/de/staropensource/engine/logging/Logger.kt +++ b/logging/src/main/kotlin/de/staropensource/engine/logging/Logger.kt @@ -114,7 +114,14 @@ class Logger { } // Create 'Call' instance - var call: Call = Call(origin, level, message, channel) + var call: Call = Call( + origin.className, + origin.methodName, + origin.lineNumber, + level, + message, + channel + ) // Run processing if (level == Level.CRASH) diff --git a/logging/src/main/kotlin/de/staropensource/engine/logging/implementation/SOSLSv2FormatBuilder.kt b/logging/src/main/kotlin/de/staropensource/engine/logging/implementation/SOSLSv2FormatBuilder.kt index 304fc9e..a9a1748 100644 --- a/logging/src/main/kotlin/de/staropensource/engine/logging/implementation/SOSLSv2FormatBuilder.kt +++ b/logging/src/main/kotlin/de/staropensource/engine/logging/implementation/SOSLSv2FormatBuilder.kt @@ -146,12 +146,12 @@ class SOSLSv2FormatBuilder(call: Call) : FormatBuilder(call) { // TODO sanitization (, )? format .append("#") - .append(call.origin.methodName) + .append(call.methodName) - if (enabledFeatures.contains(Feature.LINE_NUMBER) && call.origin.lineNumber >= 0) + if (enabledFeatures.contains(Feature.LINE_NUMBER) && call.lineNumber >= 0) format .append("~L") - .append(call.origin.lineNumber) + .append(call.lineNumber) } } } diff --git a/logging/src/main/kotlin/de/staropensource/engine/logging/implementation/crashcategory/InfoCrashCategory.kt b/logging/src/main/kotlin/de/staropensource/engine/logging/implementation/crashcategory/InfoCrashCategory.kt index 5a79930..1223a23 100644 --- a/logging/src/main/kotlin/de/staropensource/engine/logging/implementation/crashcategory/InfoCrashCategory.kt +++ b/logging/src/main/kotlin/de/staropensource/engine/logging/implementation/crashcategory/InfoCrashCategory.kt @@ -62,10 +62,9 @@ class InfoCrashCategory private constructor() : CrashCategory { ): LinkedHashMap { return linkedMapOf( Pair("Origin", linkedMapOf( - Pair("Class", call.origin.className), - Pair("Method", call.origin.methodName), - Pair("Line", call.origin.lineNumber), - Pair("Native", if (call.origin.isNativeMethod) "yes" else "false") + Pair("Class", call.origin), + Pair("Method", call.methodName), + Pair("Line", call.lineNumber), )), Pair("Channel", call.channel), Pair("Fatal", if (fatal) "yes" else "no"), diff --git a/logging/src/main/kotlin/de/staropensource/engine/logging/type/Call.kt b/logging/src/main/kotlin/de/staropensource/engine/logging/type/Call.kt index dd700fd..1b46323 100644 --- a/logging/src/main/kotlin/de/staropensource/engine/logging/type/Call.kt +++ b/logging/src/main/kotlin/de/staropensource/engine/logging/type/Call.kt @@ -23,14 +23,18 @@ package de.staropensource.engine.logging.type /** * Holds information about log calls. * - * @param origin origin + * @param origin package + class name that made the call + * @param methodName name of the method that made the call + * @param lineNumber line number where the call was made * @param level level * @param message message * @param channel channel * @since v1-alpha10 */ data class Call( - val origin: StackTraceElement, + val origin: String, + val methodName: String, + val lineNumber: Int, val level: Level, var message: String, val channel: String = "default",