Skip to content

Commit

Permalink
refactor: no more interactive spinner for connection to KM + change p…
Browse files Browse the repository at this point in the history
…m2 log format + remove some logs
  • Loading branch information
Unitech committed Feb 2, 2018
1 parent b9c01c9 commit d1916f4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/God.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ God.handleExit = function handleExit(clu, exit_code, kill_signal) {
God.notify('exit', proc);

if (God.pm2_being_killed) {
console.log('[HandleExit] PM2 is being killed, stopping restart procedure...');
//console.log('[HandleExit] PM2 is being killed, stopping restart procedure...');
return false;
}

Expand Down
6 changes: 1 addition & 5 deletions lib/Interactor/InteractorDaemonizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ var daemonize = function(conf, infos, cb) {
stdio : ['ipc', out, err]
});

UX.processing.start();
console.log('[KM] Connecting');

fs.writeFileSync(conf.INTERACTOR_PID_PATH, child.pid);

Expand All @@ -246,8 +246,6 @@ var daemonize = function(conf, infos, cb) {
child.unref();

var t = setTimeout(function() {
UX.processing.stop();

Common.printOut(cst.PREFIX_MSG_WARNING + ' Not managed to connect to Keymetrics, retrying in background. (check %s)', cst.INTERACTOR_LOG_FILE_PATH);
child.removeAllListeners('message');
child.removeAllListeners('error');
Expand All @@ -259,8 +257,6 @@ var daemonize = function(conf, infos, cb) {
clearTimeout(t);
debug('Interactor daemon launched', msg);

UX.processing.stop();

if (msg.debug) {
return cb(null, msg, child);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ var Utility = module.exports = {

// Generate timestamp prefix
function timestamp(){
return moment().format(cst.PM2_LOG_DATE_FORMAT) + ': ';
return '[' + moment().format(cst.PM2_LOG_DATE_FORMAT) + ']';
}

var hacks = ['info', 'log', 'error', 'warn'], consoled = {};
Expand All @@ -108,7 +108,7 @@ var Utility = module.exports = {
});
}
// do not destroy variable insertion
arguments[0] && (arguments[0] = timestamp() + arguments[0]);
arguments[0] && (arguments[0] = timestamp() + ' PM2 ' + k + ': ' + arguments[0]);
consoled[k].apply(console, arguments);
};
});
Expand Down

0 comments on commit d1916f4

Please sign in to comment.