Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var header = function(lvl, clientId, options) {
if (npmlog.levels[npmlog.level] <= npmlog.levels[lvl]) {
npmlog.log(lvl, clientId, HEADER_BANNER);
npmlog.log(lvl, clientId, '| IBM MQ Light Node.js Client Module -',
options.title);
npmlog.log(lvl, clientId, HEADER_BANNER);
npmlog.log(lvl, clientId, '| Date/Time :-',
moment().format('ddd MMMM DD YYYY HH:mm:ss.SSS Z'));
npmlog.log(lvl, clientId, '| Host Name :-', os.hostname());
npmlog.log(lvl, clientId, '| Operating System :-',
os.type(), os.release());
npmlog.log(lvl, clientId, '| Architecture :-',
os.platform(), os.arch());
npmlog.log(lvl, clientId, '| Node Version :-', process.version);
npmlog.log(lvl, clientId, '| Node Path :-', process.execPath);
npmlog.log(lvl, clientId, '| Node Arguments :-', process.execArgs);
if (!isWin) {
npmlog.log(lvl, clientId, '| User Id :-', process.getuid());
npmlog.log(lvl, clientId, '| Group Id :-', process.getgid());
}
npmlog.log(lvl, clientId, '| Name :-', pkg.name);
npmlog.log(lvl, clientId, '| Version :-', pkg.version);
npmlog.log(lvl, clientId, '| Description :-', pkg.description);
npmlog.log(lvl, clientId, '| Installation Path :-', __dirname);
npmlog.log(lvl, clientId, '| Uptime :-', process.uptime());
if (!isWin) {
npmlog.log(lvl, clientId, '| User Id :-', process.getuid());
npmlog.log(lvl, clientId, '| Group Id :-', process.getgid());
}
npmlog.log(lvl, clientId, '| Name :-', pkg.name);
npmlog.log(lvl, clientId, '| Version :-', pkg.version);
npmlog.log(lvl, clientId, '| Description :-', pkg.description);
npmlog.log(lvl, clientId, '| Installation Path :-', __dirname);
npmlog.log(lvl, clientId, '| Uptime :-', process.uptime());
npmlog.log(lvl, clientId, '| Log Level :-', npmlog.level);
npmlog.log(lvl, clientId, '| Data Size :-', dataSize);
if ('fnc' in options) {
npmlog.log(lvl, clientId, '| Function :-', options.fnc);
}
if ('probeId' in options) {
npmlog.log(lvl, clientId, '| Probe Id :-', options.probeId);
}
if ('ffdcSequence' in options) {
npmlog.log(lvl, clientId, '| FFDCSequenceNumber:-',
options.ffdcSequence++);
}
if (potentialUnwinds !== 0) {
npmlog.log(lvl, clientId, '| potentialUnwinds :-', potentialUnwinds);
}
npmlog.log(lvl, clientId, HEADER_BANNER);
if ('fnc' in options && options.fnc.indexOf('SIG') == 0) {
npmlog.log(lvl, clientId, '(Set MQLIGHT_NODE_NO_HANDLER to ' +
'disable user requested FFDCs)');
}
npmlog.log(lvl, clientId, '');
}
};
npmlog.log(lvl, clientId, '| Date/Time :-',
moment().format('ddd MMMM DD YYYY HH:mm:ss.SSS Z'));
npmlog.log(lvl, clientId, '| Host Name :-', os.hostname());
npmlog.log(lvl, clientId, '| Operating System :-',
os.type(), os.release());
npmlog.log(lvl, clientId, '| Architecture :-',
os.platform(), os.arch());
npmlog.log(lvl, clientId, '| Node Version :-', process.version);
npmlog.log(lvl, clientId, '| Node Path :-', process.execPath);
npmlog.log(lvl, clientId, '| Node Arguments :-', process.execArgs);
if (!isWin) {
npmlog.log(lvl, clientId, '| User Id :-', process.getuid());
npmlog.log(lvl, clientId, '| Group Id :-', process.getgid());
}
npmlog.log(lvl, clientId, '| Name :-', pkg.name);
npmlog.log(lvl, clientId, '| Version :-', pkg.version);
npmlog.log(lvl, clientId, '| Description :-', pkg.description);
npmlog.log(lvl, clientId, '| Installation Path :-', __dirname);
npmlog.log(lvl, clientId, '| Uptime :-', process.uptime());
npmlog.log(lvl, clientId, '| Log Level :-', npmlog.level);
npmlog.log(lvl, clientId, '| Data Size :-', dataSize);
if ('fnc' in options) {
npmlog.log(lvl, clientId, '| Function :-', options.fnc);
}
if ('probeId' in options) {
npmlog.log(lvl, clientId, '| Probe Id :-', options.probeId);
}
if ('ffdcSequence' in options) {
npmlog.log(lvl, clientId, '| FFDCSequenceNumber:-',
options.ffdcSequence++);
}
if (potentialUnwinds !== 0) {
var header = function(lvl, clientId, options) {
if (npmlog.levels[npmlog.level] <= npmlog.levels[lvl]) {
npmlog.log(lvl, clientId, HEADER_BANNER);
npmlog.log(lvl, clientId, '| IBM MQ Light Node.js Client Module -',
options.title);
npmlog.log(lvl, clientId, HEADER_BANNER);
npmlog.log(lvl, clientId, '| Date/Time :-',
moment().format('ddd MMMM DD YYYY HH:mm:ss.SSS Z'));
npmlog.log(lvl, clientId, '| Host Name :-', os.hostname());
npmlog.log(lvl, clientId, '| Operating System :-',
os.type(), os.release());
npmlog.log(lvl, clientId, '| Architecture :-',
os.platform(), os.arch());
npmlog.log(lvl, clientId, '| Node Version :-', process.version);
npmlog.log(lvl, clientId, '| Node Path :-', process.execPath);
npmlog.log(lvl, clientId, '| Node Arguments :-', process.execArgs);
if (!isWin) {
npmlog.log(lvl, clientId, '| User Id :-', process.getuid());
npmlog.log(lvl, clientId, '| Group Id :-', process.getgid());
}
npmlog.log(lvl, clientId, '| IBM MQ Light Node.js Client Module -',
options.title);
npmlog.log(lvl, clientId, HEADER_BANNER);
npmlog.log(lvl, clientId, '| Date/Time :-',
moment().format('ddd MMMM DD YYYY HH:mm:ss.SSS Z'));
npmlog.log(lvl, clientId, '| Host Name :-', os.hostname());
npmlog.log(lvl, clientId, '| Operating System :-',
os.type(), os.release());
npmlog.log(lvl, clientId, '| Architecture :-',
os.platform(), os.arch());
npmlog.log(lvl, clientId, '| Node Version :-', process.version);
npmlog.log(lvl, clientId, '| Node Path :-', process.execPath);
npmlog.log(lvl, clientId, '| Node Arguments :-', process.execArgs);
if (!isWin) {
npmlog.log(lvl, clientId, '| User Id :-', process.getuid());
npmlog.log(lvl, clientId, '| Group Id :-', process.getgid());
}
npmlog.log(lvl, clientId, '| Name :-', pkg.name);
npmlog.log(lvl, clientId, '| Version :-', pkg.version);
npmlog.log(lvl, clientId, '| Description :-', pkg.description);
npmlog.log(lvl, clientId, '| Installation Path :-', __dirname);
npmlog.log(lvl, clientId, '| Uptime :-', process.uptime());
npmlog.log(lvl, clientId, '| Log Level :-', npmlog.level);
npmlog.log(lvl, clientId, '| Data Size :-', dataSize);
if ('fnc' in options) {
npmlog.log(lvl, clientId, '| Function :-', options.fnc);
}
if ('probeId' in options) {
npmlog.log(lvl, clientId, '| Probe Id :-', options.probeId);
}
if ('ffdcSequence' in options) {
npmlog.log(lvl, clientId, '| FFDCSequenceNumber:-',
logger.entryLevel = function(lvl, name, id) {
if (exceptionThrown) {
logger.log('error', id, '* Uncaught exception');
exceptionThrown = null;
while (stack.length > 1) {
stack.pop();
}
}
npmlog.log(lvl, id, ENTRY_IND.substring(0, stack.length), name);
stack.push(name);
};
const log = (level, message) => npmlog.log(level, `${baseUrl}:${deviceToken}`, message)
if ('fnc' in options) {
npmlog.log(lvl, clientId, '| Function :-', options.fnc);
}
if ('probeId' in options) {
npmlog.log(lvl, clientId, '| Probe Id :-', options.probeId);
}
if ('ffdcSequence' in options) {
npmlog.log(lvl, clientId, '| FFDCSequenceNumber:-',
options.ffdcSequence++);
}
if (potentialUnwinds !== 0) {
npmlog.log(lvl, clientId, '| potentialUnwinds :-', potentialUnwinds);
}
npmlog.log(lvl, clientId, HEADER_BANNER);
if ('fnc' in options && options.fnc.indexOf('SIG') == 0) {
npmlog.log(lvl, clientId, '(Set MQLIGHT_NODE_NO_HANDLER to ' +
'disable user requested FFDCs)');
}
npmlog.log(lvl, clientId, '');
}
};
npmlog.log(lvl, clientId, '| Node Version :-', process.version);
npmlog.log(lvl, clientId, '| Node Path :-', process.execPath);
npmlog.log(lvl, clientId, '| Node Arguments :-', process.execArgs);
if (!isWin) {
npmlog.log(lvl, clientId, '| User Id :-', process.getuid());
npmlog.log(lvl, clientId, '| Group Id :-', process.getgid());
}
npmlog.log(lvl, clientId, '| Name :-', pkg.name);
npmlog.log(lvl, clientId, '| Version :-', pkg.version);
npmlog.log(lvl, clientId, '| Description :-', pkg.description);
npmlog.log(lvl, clientId, '| Installation Path :-', __dirname);
npmlog.log(lvl, clientId, '| Uptime :-', process.uptime());
npmlog.log(lvl, clientId, '| Log Level :-', npmlog.level);
npmlog.log(lvl, clientId, '| Data Size :-', dataSize);
if ('fnc' in options) {
npmlog.log(lvl, clientId, '| Function :-', options.fnc);
}
if ('probeId' in options) {
npmlog.log(lvl, clientId, '| Probe Id :-', options.probeId);
}
if ('ffdcSequence' in options) {
npmlog.log(lvl, clientId, '| FFDCSequenceNumber:-',
options.ffdcSequence++);
}
if (potentialUnwinds !== 0) {
npmlog.log(lvl, clientId, '| potentialUnwinds :-', potentialUnwinds);
}
npmlog.log(lvl, clientId, HEADER_BANNER);
if ('fnc' in options && options.fnc.indexOf('SIG') == 0) {
npmlog.log(lvl, clientId, '(Set MQLIGHT_NODE_NO_HANDLER to ' +
'disable user requested FFDCs)');
}
logger.body = function(id, data) {
if (npmlog.levels[npmlog.level] <= npmlog.levels.data) {
npmlog.log('data', id, '! length:', data.length);
if (typeof data === 'string') {
if ((dataSize >= data.length) || (dataSize < 0)) {
npmlog.log('data', id, '! string:', data);
} else {
npmlog.log('data', id, '! string:', data.substring(0, dataSize), '...');
}
} else {
if ((dataSize >= data.length) || (dataSize < 0)) {
npmlog.log('data', id, '! buffer:',
data.toString('hex'));
} else {
npmlog.log('data', id, '! buffer:',
data.toString('hex', 0, dataSize), '...');
}
}
}
};