Rename methods, update default value for methodCaller(depth)

This commit is contained in:
JeremyStar™ 2024-12-20 02:50:06 +01:00
parent 9d001032c2
commit 3b532a2dda
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
4 changed files with 4 additions and 4 deletions

View file

@ -108,7 +108,7 @@ class Logger {
fun log(level: Level, message: String, levelData: Map<String, Object?> = 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

View file

@ -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

View file

@ -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(

View file

@ -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<StackTraceElement> = Throwable().stackTrace
var element: StackTraceElement? = null