How to use the logger.debug function in logger

To help you get started, we’ve selected a few logger 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 WPO-Foundation / webpagetest / agent / js / src / adb.js View on Github external
function(stdout) {
        var resolvedPath = stdout.trim(); // remove newline.
        if (!resolvedPath) {
          return tryRemainingPaths(pathsToTry);
        }
        logger.debug('Found storage path %s --> %s', path, resolvedPath);
        // Return the resolved path (e.g. '/sdcard' not '$EXTERNAL_STORAGE'),
        // so the caller can `adb push/pull` files to the absolute path.
        this.storagePath_ = resolvedPath;
        return resolvedPath;
      }.bind(this));
    }.bind(this));
github WPO-Foundation / webpagetest / agent / js / src / agent_main.js View on Github external
process_utils.scheduleGetAll(this.app_).then(function(processInfos) {
      var pid = process.pid;
      var pi; // Declare outside the loop, to avoid a jshint warning
      while (pid) {
        pi = undefined;
        for (var i = 0; i < processInfos.length; ++i) {
          if (processInfos[i].pid === pid) {
            pi = processInfos.splice(i, 1)[0];
            logger.debug('Not killing user %s pid=%s: %s %s', process.env.USER,
                pid, pi.command, pi.args.join(' '));
            break;
          }
        }
        pid = (pi ? pi.ppid : undefined);
      }
      if (processInfos.length > 0) {
        logger.info('Killing %s pids owned by user %s: %s', processInfos.length,
            process.env.USER,
            processInfos.map(function(pi) { return pi.pid; }).join(', '));
        process_utils.scheduleKillAll(
            this.app_, 'Kill dangling pids', processInfos);
      }
    }.bind(this), function(e) {
      logger.error('Unable to killall pids: ' + e.message);
github WPO-Foundation / webpagetest / agent / js / src / process_utils.js View on Github external
return app.schedule(cmd, function() {
    logger.debug('Exec with timeout(%d): %s', timeout, cmd);

    // Create output buffers
    var stdout = '';
    var stderr = '';
    function newMsg(desc, code, signal) {
      function crop(s, n) {
        return (s.length <= n ? s : s.substring(0, n - 3) + '...');
      }
      var ret = [desc, code && 'code ' + code, signal && 'signal ' + signal,
          stdout && 'stdout[' + stdout.length + '] ' + crop(stdout, 1024),
          stderr && 'stderr[' + stderr.length + '] ' + crop(stderr, 1024)];
      // Comma-separated elements of ret, except the undefined ones.
      return ret.filter(function(v) { return !!v; }).join(', ');
    }
    function newError(desc, code, signal) {
      var ret = new Error(newMsg(desc, code, signal));
github WPO-Foundation / webpagetest / agent / js / src / wd_server.js View on Github external
WebDriverServer.prototype.saveScreenshot_ = function(
    fileName, screenshot, description) {
  'use strict';
  logger.debug('Saving screenshot %s (%d bytes): %s',
      fileName, screenshot.length, description);
  var diskPath = path.join(this.runTempDir_, fileName);
  return process_utils.scheduleFunction(this.app_,
      'Write screenshot file ' + diskPath,
      fs.writeFile, diskPath, screenshot).then(function() {
    return this.addScreenshot_(fileName, diskPath, description);
  }.bind(this));
};
github Tencent / TSW / bin / tsw / util / auto-report / logReport.js View on Github external
CD.curr(`SUM_TSW_ALPHA_LOG_KEY.${currDays}`, logNumMax, 24 * 60 * 60).fail(function (err) {
    logger.debug(err && err.stack);
    returnJson('服务器错误');
  }).done(function (count) {
    count = ~~count;
github Tencent / TSW / bin / tsw / api / fileCache / index.js View on Github external
fs.utimes(filename, atime || new Date(), mtime || new Date(), function(err) {
        if (err) {
            logger.debug(err.stack);
            return;
        }

        logger.debug(`[updateMtime] ${filename} succ`);
    });
};

logger

A simple logging library that combines the simple APIs of Ruby's logger.rb and browser-js console.log()

Unknown
Latest version published 10 years ago

Package Health Score

36 / 100
Full package analysis

Popular logger functions