Logging: don't include inner class names in log output (i.e. trim anything after the $ sign in the class name)

This commit is contained in:
Mike Hearn 2016-01-29 13:58:50 +00:00 committed by Mike Hearn
parent fbd4b60834
commit 606926a692

View File

@ -34,8 +34,8 @@ class BriefLogFormatter : Formatter() {
val arguments = arrayOfNulls<Any>(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)