From 606926a692defea674b198aba356116e56483e9b Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Fri, 29 Jan 2016 13:58:50 +0000 Subject: [PATCH] Logging: don't include inner class names in log output (i.e. trim anything after the $ sign in the class name) --- src/main/kotlin/core/utilities/Logging.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/core/utilities/Logging.kt b/src/main/kotlin/core/utilities/Logging.kt index 1c75f86758..5b298db617 100644 --- a/src/main/kotlin/core/utilities/Logging.kt +++ b/src/main/kotlin/core/utilities/Logging.kt @@ -34,8 +34,8 @@ class BriefLogFormatter : Formatter() { val arguments = arrayOfNulls(6) arguments[0] = logRecord.threadID val fullClassName = logRecord.sourceClassName - val lastDot = fullClassName.lastIndexOf('.') - val className = fullClassName.substring(lastDot + 1) + val dollarIndex = fullClassName.indexOf('$') + val className = fullClassName.substring(fullClassName.lastIndexOf('.') + 1, if (dollarIndex == -1) fullClassName.length else dollarIndex) arguments[1] = className arguments[2] = logRecord.sourceMethodName arguments[3] = Date(logRecord.millis)