logging improved
This commit is contained in:
1 parent
860bcfc39e
commit
f37c99dc95
2 files changed
+7
-5
No files matched your search
@@ -1,4 +1,7 @@
|
||||
exports.newSystemEventHandler = function newSystemEventHandler(ipc) {
|
||||
|
||||
const MODULE = "Task Server -> System Event Handler -> "
|
||||
|
||||
let thisObject = {
|
||||
initialize: initialize,
|
||||
finalize: finalize,
|
||||
@@ -26,7 +29,7 @@
|
||||
ipc.of.world.on(
|
||||
'connect',
|
||||
function () {
|
||||
ipc.log('## Connected to Superalgos Event Server ##'.rainbow, ipc.config.delay);
|
||||
ipc.log(MODULE + '## Connected to Superalgos Event Server ##'.rainbow, ipc.config.delay);
|
||||
|
||||
let eventCommand = {
|
||||
action: 'greetings',
|
||||
@@ -41,7 +44,7 @@
|
||||
ipc.of.world.on(
|
||||
'disconnect',
|
||||
function () {
|
||||
ipc.log('Disconnected from Superalgos Event Server '.notice);
|
||||
ipc.log(MODULE + 'Disconnected from Superalgos Event Server '.notice);
|
||||
}
|
||||
);
|
||||
ipc.of.world.on(
|
||||
@@ -63,8 +66,8 @@
|
||||
if (handler) {
|
||||
handler.callBack(message)
|
||||
} else {
|
||||
console.log(key + ' not found so could not deliver event raised.')
|
||||
console.log(' Message = ' + data)
|
||||
console.log(MODULE + key + ' not found so could not deliver event raised.')
|
||||
console.log(MODULE + ' Message = ' + data)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@ process.on('exit', function (code) {
|
||||
let key = global.TASK_NODE.name + '-' + global.TASK_NODE.type + '-' + global.TASK_NODE.id
|
||||
|
||||
global.SYSTEM_EVENT_HANDLER.raiseEvent(key, 'Stopped') // Meaning Task Stopped
|
||||
global.SYSTEM_EVENT_HANDLER.deleteEventHandler(key)
|
||||
global.SYSTEM_EVENT_HANDLER.finalize()
|
||||
global.SYSTEM_EVENT_HANDLER = undefined
|
||||
|
||||
|
||||
Reference in new issue
Block a user