Only creating expensive log message if DEBUG log level is really enabled

This commit is contained in:
dankito 2020-05-13 20:43:21 +02:00
parent 2df12c4984
commit 7226b0965d
1 changed files with 3 additions and 1 deletions

View File

@ -633,7 +633,9 @@ open class FinTsClient @JvmOverloads constructor(
val prettyPrintMessageWithoutSensitiveData = removeSensitiveDataFromMessage(prettyPrintMessage, dialogContext) val prettyPrintMessageWithoutSensitiveData = removeSensitiveDataFromMessage(prettyPrintMessage, dialogContext)
if (log.isDebugEnabled) {
log.debug("${if (type == MessageLogEntryType.Sent) "Sending" else "Received"} message:\n$prettyPrintMessage") log.debug("${if (type == MessageLogEntryType.Sent) "Sending" else "Received"} message:\n$prettyPrintMessage")
}
messageLogField.add(MessageLogEntry(prettyPrintMessageWithoutSensitiveData, timeStamp, dialogContext.customer)) messageLogField.add(MessageLogEntry(prettyPrintMessageWithoutSensitiveData, timeStamp, dialogContext.customer))
} }