diff options
author | Antoine A <> | 2024-03-12 23:03:02 +0100 |
---|---|---|
committer | Antoine A <> | 2024-03-13 21:19:30 +0100 |
commit | 651217a5c089bd20d94f9b4760e13f491bc26861 (patch) | |
tree | 4a8168faeba67b6bf5402edbbc288ad7c129640e /common/src/main/kotlin/Cli.kt | |
parent | cd6421f1c45e1a51415c19c1e28eed8a91c56008 (diff) | |
download | libeufin-651217a5c089bd20d94f9b4760e13f491bc26861.tar.gz libeufin-651217a5c089bd20d94f9b4760e13f491bc26861.tar.bz2 libeufin-651217a5c089bd20d94f9b4760e13f491bc26861.zip |
Improve submission order to guarantee progress and improve testbench
Diffstat (limited to 'common/src/main/kotlin/Cli.kt')
-rw-r--r-- | common/src/main/kotlin/Cli.kt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/common/src/main/kotlin/Cli.kt b/common/src/main/kotlin/Cli.kt index fcf17688..ae9d8e87 100644 --- a/common/src/main/kotlin/Cli.kt +++ b/common/src/main/kotlin/Cli.kt @@ -37,7 +37,7 @@ import kotlinx.coroutines.* private val logger: Logger = LoggerFactory.getLogger("libeufin-config") -fun Throwable.fmtLog(logger: Logger) { +fun Throwable.fmt(): String{ var msg = StringBuilder(message ?: this::class.simpleName) var cause = cause while (cause != null) { @@ -45,7 +45,11 @@ fun Throwable.fmtLog(logger: Logger) { msg.append(cause.message ?: cause::class.simpleName) cause = cause.cause } - logger.error(msg.toString()) + return msg.toString() +} + +fun Throwable.fmtLog(logger: Logger) { + logger.error(this.fmt()) logger.trace("", this) } |