How to use the npmlog.log function in npmlog

To help you get started, we’ve selected a few npmlog examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mqlight / nodejs-mqlight / mqlight-log.js View on Github external
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());
github mqlight / nodejs-mqlight / mqlight-log.js View on Github external
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, '');
  }
};
github mqlight / nodejs-mqlight / mqlight-log.js View on Github external
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) {
github mqlight / nodejs-mqlight / mqlight-log.js View on Github external
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());
    }
github mqlight / nodejs-mqlight / mqlight-log.js View on Github external
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:-',
github mqlight / nodejs-mqlight / mqlight-log.js View on Github external
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);
};
github Gargron / tusky-api / index.js View on Github external
  const log = (level, message) => npmlog.log(level, `${baseUrl}:${deviceToken}`, message)
github mqlight / nodejs-mqlight / mqlight-log.js View on Github external
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, '');
  }
};
github mqlight / nodejs-mqlight / mqlight-log.js View on Github external
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)');
    }
github mqlight / nodejs-mqlight / mqlight-log.js View on Github external
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), '...');
      }
    }
  }
};