From 3b532a2dda9fb9985d826a40cb26da5b4bc96c96 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Fri, 20 Dec 2024 02:50:06 +0100 Subject: [PATCH] Rename methods, update default value for methodCaller(depth) --- .../main/kotlin/de/staropensource/engine/base/logging/Logger.kt | 2 +- .../kotlin/de/staropensource/engine/base/utility/Environment.kt | 2 +- .../engine/base/utility/dnihbd/BuildInformation.kt | 2 +- .../staropensource/engine/base/utility/misc/StackTraceUtils.kt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/base/src/main/kotlin/de/staropensource/engine/base/logging/Logger.kt b/base/src/main/kotlin/de/staropensource/engine/base/logging/Logger.kt index f2a038a57..195fd98b7 100644 --- a/base/src/main/kotlin/de/staropensource/engine/base/logging/Logger.kt +++ b/base/src/main/kotlin/de/staropensource/engine/base/logging/Logger.kt @@ -108,7 +108,7 @@ class Logger { fun log(level: Level, message: String, levelData: Map = emptyMap(), callerDepth: UInt = 0u) { // Create 'Call' instance var call: Call = Call( - StackTraceUtils.getMethodCaller(callerDepth.plus(1u)), + StackTraceUtils.methodCaller(depth = callerDepth.plus(1u)), level, message, channel diff --git a/base/src/main/kotlin/de/staropensource/engine/base/utility/Environment.kt b/base/src/main/kotlin/de/staropensource/engine/base/utility/Environment.kt index c55337aa2..1eebdcbef 100644 --- a/base/src/main/kotlin/de/staropensource/engine/base/utility/Environment.kt +++ b/base/src/main/kotlin/de/staropensource/engine/base/utility/Environment.kt @@ -303,7 +303,7 @@ class Environment private constructor() { * @return maximum clock speed of logical processors in Hz or `-1` if it couldn't be determined * @since v1-alpha10 */ - fun getCPUMaxFrequency(): Long? = hw?.processor?.maxFreq + fun getCPUMaximumFrequency(): Long? = hw?.processor?.maxFreq /** * Returns the estimated current clock diff --git a/base/src/main/kotlin/de/staropensource/engine/base/utility/dnihbd/BuildInformation.kt b/base/src/main/kotlin/de/staropensource/engine/base/utility/dnihbd/BuildInformation.kt index b9c9203d3..e3ec044f8 100644 --- a/base/src/main/kotlin/de/staropensource/engine/base/utility/dnihbd/BuildInformation.kt +++ b/base/src/main/kotlin/de/staropensource/engine/base/utility/dnihbd/BuildInformation.kt @@ -339,7 +339,7 @@ open class BuildInformation protected fun getFileContent(file: String): String? { if (loadLocation == null) { // Read from resources - val origin: Origin = StackTraceUtils.getMethodCaller(2u) + val origin: Origin = StackTraceUtils.methodCaller(depth = 2u) val reader: Reader try { reader = InputStreamReader( diff --git a/base/src/main/kotlin/de/staropensource/engine/base/utility/misc/StackTraceUtils.kt b/base/src/main/kotlin/de/staropensource/engine/base/utility/misc/StackTraceUtils.kt index 75f96be31..f91f7ae81 100644 --- a/base/src/main/kotlin/de/staropensource/engine/base/utility/misc/StackTraceUtils.kt +++ b/base/src/main/kotlin/de/staropensource/engine/base/utility/misc/StackTraceUtils.kt @@ -42,7 +42,7 @@ class StackTraceUtils private constructor() { * @return deepest method caller * @since v1-alpha10 */ - fun getMethodCaller(depth: UInt = 0u): Origin { + fun methodCaller(depth: UInt = 1u): Origin { val stacktrace: Array = Throwable().stackTrace var element: StackTraceElement? = null