mirror of
https://github.com/corda/corda.git
synced 2025-06-18 07:08:15 +00:00
Print to screen and log basic info (#356)
Adding an extra logger to printBasicNodeInfo in both console and log file, respectively. Also, node's legal name is now printed to console as well.
This commit is contained in:
committed by
GitHub
parent
c2c9df2145
commit
195d69d0dc
@ -25,13 +25,9 @@ private var renderBasicInfoToConsole = true
|
||||
|
||||
/** Used for useful info that we always want to show, even when not logging to the console */
|
||||
fun printBasicNodeInfo(description: String, info: String? = null) {
|
||||
if (renderBasicInfoToConsole) {
|
||||
val msg = if (info == null) description else "${description.padEnd(40)}: $info"
|
||||
println(msg)
|
||||
} else {
|
||||
val msg = if (info == null) description else "$description: $info"
|
||||
LoggerFactory.getLogger("Main").info(msg)
|
||||
}
|
||||
val msg = if (info == null) description else "${description.padEnd(40)}: $info"
|
||||
val loggerName = if (renderBasicInfoToConsole) "BasicInfo" else "Main"
|
||||
LoggerFactory.getLogger(loggerName).info(msg)
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
@ -125,7 +121,7 @@ fun main(args: Array<String>) {
|
||||
|
||||
node.networkMapRegistrationFuture.success {
|
||||
val elapsed = (System.currentTimeMillis() - startTime) / 10 / 100.0
|
||||
printBasicNodeInfo("Node started up and registered in $elapsed sec")
|
||||
printBasicNodeInfo("Node ${node.info.legalIdentity.name} started up and registered in $elapsed sec")
|
||||
|
||||
if (renderBasicInfoToConsole)
|
||||
ANSIProgressObserver(node.smm)
|
||||
|
@ -139,7 +139,7 @@ class ArtemisMessagingServer(override val config: NodeConfiguration,
|
||||
registerPostQueueDeletionCallback { address, qName -> log.debug { "Queue deleted: $qName for $address" } }
|
||||
}
|
||||
activeMQServer.start()
|
||||
printBasicNodeInfo("Node listening on address", myHostPort.toString())
|
||||
printBasicNodeInfo("Node ${this.config.myLegalName} listening on address", myHostPort.toString())
|
||||
}
|
||||
|
||||
private fun createArtemisConfig(): Configuration = ConfigurationImpl().apply {
|
||||
|
Reference in New Issue
Block a user