From 11bcaf5fb219e803b8c9a1a116e15d90c3980b81 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Mon, 10 Oct 2016 12:00:36 +0200 Subject: [PATCH] Minor: go back to using logging for the trader demo specific output (i.e. admit defeat with the ANSI renderer, which is not long for this world anyway) --- .../com/r3corda/node/utilities/ANSIProgressObserver.kt | 1 - src/main/kotlin/com/r3corda/demos/TraderDemo.kt | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/node/src/main/kotlin/com/r3corda/node/utilities/ANSIProgressObserver.kt b/node/src/main/kotlin/com/r3corda/node/utilities/ANSIProgressObserver.kt index 564cb0387e..5420adc6b9 100644 --- a/node/src/main/kotlin/com/r3corda/node/utilities/ANSIProgressObserver.kt +++ b/node/src/main/kotlin/com/r3corda/node/utilities/ANSIProgressObserver.kt @@ -11,7 +11,6 @@ import java.util.* * they are added to the [StateMachineManager]. */ class ANSIProgressObserver(val smm: StateMachineManager) { - init { smm.changes.subscribe { change -> when (change.addOrRemove) { diff --git a/src/main/kotlin/com/r3corda/demos/TraderDemo.kt b/src/main/kotlin/com/r3corda/demos/TraderDemo.kt index 65e425b91d..61573b9e02 100644 --- a/src/main/kotlin/com/r3corda/demos/TraderDemo.kt +++ b/src/main/kotlin/com/r3corda/demos/TraderDemo.kt @@ -191,7 +191,7 @@ private fun runSeller(node: Node, amount: Amount, otherSide: Party) { } tradeTX.success { - println("Sale completed - we have a happy customer!\n\nFinal transaction is:\n\n${Emoji.renderIfSupported(it.tx)}") + log.info("Sale completed - we have a happy customer!\n\nFinal transaction is:\n\n${Emoji.renderIfSupported(it.tx)}") thread { node.stop() } @@ -250,7 +250,7 @@ private class TraderDemoProtocolBuyer(val otherSide: Party, // TODO: This should be moved into the protocol itself. serviceHub.recordTransactions(listOf(tradeTX)) - println("Purchase complete - we are a happy customer! Final transaction is: " + + log.info("Purchase complete - we are a happy customer! Final transaction is: " + "\n\n${Emoji.renderIfSupported(tradeTX.tx)}") logIssuanceAttachment(tradeTX) @@ -271,7 +271,7 @@ private class TraderDemoProtocolBuyer(val otherSide: Party, cpIssuance.attachments.first().let { val p = attachmentsPath.toAbsolutePath().resolve("$it.jar") - println(""" + log.info(""" The issuance of the commercial paper came with an attachment. You can find it expanded in this directory: $p