Simplified getting error logger

This commit is contained in:
dankito 2024-08-20 11:24:04 +02:00
parent 6b6dfd48b8
commit f309251285
1 changed files with 1 additions and 9 deletions

View File

@ -45,11 +45,7 @@ open class MessageLogCollector {
val type = MessageLogEntryType.Error
val messageToLog = createMessage(type, message, context, false)
if (e != null) {
getLogger(loggingClass).error(e) { messageToLog }
} else {
getLogger(loggingClass).error { messageToLog }
}
LoggerFactory.getLogger(loggingClass).error(e) { messageToLog }
val errorStackTrace = if (e != null) NewLine + getStackTrace(e) else ""
@ -149,8 +145,4 @@ open class MessageLogCollector {
return if (indexOf16thLine < 0) stackTraceString else stackTraceString.substring(0, indexOf16thLine)
}
protected open fun getLogger(loggingClass: KClass<*>): Logger {
return LoggerFactory.getLogger(loggingClass)
}
}