1
0
Fork 0

events module

master
Ruben Meyer 4 years ago
parent f0863b517a
commit 6e9e666e19

@ -0,0 +1,28 @@
/*
* This file is part of the authRXBN single sign-on package.
*
* (c) Ruben Meyer <contact@rxbn.de>
*/
// init
// GCS: Global Communication System
let EventEmitter = require('events');
global['gcs'] = new EventEmitter.EventEmitter();
/**
* Error Message Handler
* @author Ruben Meyer
* @param {String} message data: "MODULE SEPARATOR MESSAGE"
* @return {void}
*/
global['gcs'].on('err', (data) => {
separator = "->";
i = data.indexOf(separator);
parts = [data.slice(0, i), data.slice(i+separator.length)];
for (let a in parts) {
if(parts.hasOwnProperty(a))
parts[a] = parts[a].trim();
}
console.log("ERROR: Module: \""+parts[0]+"\"; Message: "+parts[1]);
});
Loading…
Cancel
Save