How to use the logger.info 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 / agent_main.js View on Github external
// Nuke any non-webdriver scripts for now.  Regular WPT
        // scripts would have been pre-processed when the task was
        // initially parsed.
        script = undefined;
      }
      url = url.trim();
      if (!((/^https?:\/\//i).test(url))) {
        url = 'http://' + url;
      }
    } catch (e) {
      job.testError = e.message;
      this.abortJob_(job);
      return;
    }

    logger.info('%s run %d%s/%d of job %s',
        (job.retryError ? 'Retrying' : 'Starting'), job.runNumber,
        (job.isFirstViewOnly ? '' : (job.isCacheWarm ? 'b' : 'a')),
        job.runs, job.id);

    if (this.wdServer_ && !job.isCacheWarm) {
      if (!job.retryError) {
        throw new Error('Internal error: unclean non-retry first view');
      }
      logger.debug('Cleaning before repeat first-view');
      this.scheduleCleanup_(job, /*isEndOfJob=*/false);
    }
    this.scheduleCleanRunTempDir_();

    if (this.isTrafficShaping_(job)) {
      this.startTrafficShaper_(job);  // Start shaping.
    } else {
github WPO-Foundation / webpagetest / agent / js / src / agent_main.js View on Github external
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 / browser_base.js View on Github external
proc.on('exit', function(code, signal) {
      logger.info(name + ' EXIT code %s signal %s', code, signal);
      this.childProcess_ = undefined;
      this.onChildProcessExit();
    }.bind(this));
  }.bind(this));
github WPO-Foundation / webpagetest / agent / js / src / devtools2har.js View on Github external
serverProcess.on('exit', function(code, signal) {
    if (code === 0) {
      logger.info('devtools2har exit code %d, signal %s', code, signal);
      callback();
    } else {
      var e = new Error(
          'devtools2har failed, exit code ' + code + ', signal ' + signal);
      logger.error(e);
      callback(e);
    }
  });
  serverProcess.stdout.on('data', function(data) {
github WPO-Foundation / webpagetest / agent / js / src / browser_ios.js View on Github external
this.proxyProcess_.on('exit', function(code, signal) {
          logger.info('Proxy EXIT code %s signal %s', code, signal);
          this.proxyProcess_ = undefined;
          this.devToolsUrl_ = undefined;
        }.bind(this));
      }.bind(this));

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

39 / 100
Full package analysis

Popular logger functions