diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/config/FinTsClientConfiguration.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/config/FinTsClientConfiguration.kt index d2bb0b5a..d124b29a 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/config/FinTsClientConfiguration.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/config/FinTsClientConfiguration.kt @@ -2,7 +2,6 @@ package net.dankito.banking.fints.config import net.dankito.banking.fints.FinTsJobExecutor import net.dankito.banking.fints.RequestExecutor -import net.dankito.banking.fints.log.MessageLogCollector import net.dankito.banking.fints.messages.MessageBuilder import net.dankito.banking.fints.model.mapper.ModelMapper import net.dankito.banking.fints.util.FinTsServerAddressFinder @@ -21,6 +20,5 @@ class FinTsClientConfiguration( modelMapper: ModelMapper = ModelMapper(messageBuilder), tanMethodSelector: TanMethodSelector = TanMethodSelector(), var jobExecutor: FinTsJobExecutor = FinTsJobExecutor(requestExecutor, messageBuilder, modelMapper, tanMethodSelector), - var finTsServerAddressFinder: FinTsServerAddressFinder = FinTsServerAddressFinder(), - var messageLogCollector: MessageLogCollector = MessageLogCollector() + var finTsServerAddressFinder: FinTsServerAddressFinder = FinTsServerAddressFinder() ) \ No newline at end of file diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/JobContext.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/JobContext.kt index ace69564..0ec9ffee 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/JobContext.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/JobContext.kt @@ -23,7 +23,8 @@ open class JobContext( /** * Only set if the current context is for a specific account (like get account's transactions). */ - open val account: AccountData? = null + open val account: AccountData? = null, + protected open val messageLogCollector: MessageLogCollector = MessageLogCollector() ) : MessageBaseData(bank, config.options.product), IMessageLogAppender { companion object { @@ -38,7 +39,7 @@ open class JobContext( open val responseParser: ResponseParser = ResponseParser(logAppender = this) open val messageLogWithoutSensitiveData: List - get() = config.messageLogCollector.messageLogWithoutSensitiveData + get() = messageLogCollector.messageLogWithoutSensitiveData open var dialog: DialogContext = DialogContext() // create null value so that variable is not null @@ -72,11 +73,11 @@ open class JobContext( open fun addMessageLog(type: MessageLogEntryType, message: String) { - config.messageLogCollector.addMessageLog(type, message, createMessageContext()) + messageLogCollector.addMessageLog(type, message, createMessageContext()) } override fun logError(loggingClass: KClass<*>, message: String, e: Exception?) { - config.messageLogCollector.logError(loggingClass, message, createMessageContext(), e) + messageLogCollector.logError(loggingClass, message, createMessageContext(), e) } protected open fun createMessageContext(): MessageContext { diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/MessageLogEntry.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/MessageLogEntry.kt index 8fb56621..8fe67592 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/MessageLogEntry.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/MessageLogEntry.kt @@ -7,8 +7,10 @@ import net.dankito.banking.fints.log.MessageContext open class MessageLogEntry( open val type: MessageLogEntryType, - open val message: String, open val context: MessageContext, + open val messageTrace: String, + open val message: String, + open val error: Throwable? = null, open val time: Instant = Clock.System.now() ) {