From 6cdce3f3f38cb67c49d0d80eb30304c640bfa95c Mon Sep 17 00:00:00 2001 From: dshuffma-ibm Date: Tue, 10 Oct 2017 11:17:16 -0400 Subject: [PATCH] Add cb for eventhub (#159) * add discconnect callback for eventhub * tweak startup logs to include url --- app.js | 4 +++- utils/fc_wrangler/invoke_cc.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 0b21ca1a7..156ee1e55 100644 --- a/app.js +++ b/app.js @@ -163,8 +163,10 @@ if (config_error) { if (err) { startup_unsuccessful(); } else { + console.log('\n'); logger.debug('Detected that we have launched successfully before'); - logger.debug('Welcome back - Initiating start up\n\n'); + logger.debug('Welcome back - Marbles is ready'); + logger.debug('Open your browser to http://' + host + ':' + port + ' and login as "admin"\n\n'); } }); }); diff --git a/utils/fc_wrangler/invoke_cc.js b/utils/fc_wrangler/invoke_cc.js index c3f4dbd89..ffef65f5c 100644 --- a/utils/fc_wrangler/invoke_cc.js +++ b/utils/fc_wrangler/invoke_cc.js @@ -116,7 +116,7 @@ module.exports = function (g_options, logger) { options.target_event_url = null; //don't use eventHub } if (options.target_event_url) { - logger.debug('[fcw] listening to tx event. url:', options.target_event_url); + logger.debug('[fcw] listening to transaction event. url:', options.target_event_url); eventHub = client.newEventHub(); eventHub.setPeerAddr(options.target_event_url, options.peer_tls_opts); eventHub.connect(); @@ -139,6 +139,8 @@ module.exports = function (g_options, logger) { return cb(null); //all good, pass it back } else return; } + }, function (disconnectMsg) { //callback whenever eventHub is disconnected, normal + logger.debug('[fcw] transaction event is disconnected'); }); } else { logger.debug('[fcw] will not use tx event');