From 7226b0965dbf74387fd1a75612cb8810b6cfb6e9 Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 13 May 2020 20:43:21 +0200 Subject: [PATCH] Only creating expensive log message if DEBUG log level is really enabled --- fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt b/fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt index 5a794ce3..0255d786 100644 --- a/fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt +++ b/fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt @@ -633,7 +633,9 @@ open class FinTsClient @JvmOverloads constructor( val prettyPrintMessageWithoutSensitiveData = removeSensitiveDataFromMessage(prettyPrintMessage, dialogContext) - log.debug("${if (type == MessageLogEntryType.Sent) "Sending" else "Received"} message:\n$prettyPrintMessage") + if (log.isDebugEnabled) { + log.debug("${if (type == MessageLogEntryType.Sent) "Sending" else "Received"} message:\n$prettyPrintMessage") + } messageLogField.add(MessageLogEntry(prettyPrintMessageWithoutSensitiveData, timeStamp, dialogContext.customer)) }