omit package name while logging

This commit is contained in:
AdrianLxM 2020-01-13 18:31:11 +01:00
parent 70c83c17e0
commit 16836ce535

View file

@ -58,7 +58,7 @@ class AAPSLoggerProduction : AAPSLogger {
}
}
fun StackTraceElement.toLogString(): String = "[${this.className}.${this.methodName}():${this.lineNumber}]: "
fun StackTraceElement.toLogString(): String = "[${this.className.substringAfterLast(".")}.${this.methodName}():${this.lineNumber}]: "
/* Needs to be inline. Don't remove even if IDE suggests it. */
private inline fun stackLogMarker() = Throwable().stackTrace[1].toLogString()