How to use the logger.error 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 / process_utils.js View on Github external
var timerId = global.setTimeout(function() {
      timerId = undefined;  // Reset it before the close listener gets called.
      try {
        proc.kill();
      } catch (e) {
        logger.error('Error killing %s: %s', cmd, e);
      }
      // The kill() call normally triggers the close listener, but we reject
      // the promise here instead of the close listener, because we don't really
      // know if and when it's going to be killed at OS level.
      // In the future we may want to restart the adb server here as a recovery
      // for wedged adb connections, or use a relay board for device recovery.
      done.reject(
          newError(cmd + ' timeout after ' + (timeout / 1000) + ' seconds'));
    }, timeout);
github paralect / koa-api-starter / src / app.js View on Github external
process.on('unhandledRejection', (reason, p) => {
  logger.error('Possibly Unhandled Rejection at: Promise ', p, ' reason: ', reason);
  // application specific logging here
});
github WPO-Foundation / webpagetest / agent / js / src / wd_server.js View on Github external
exports.process.on('message', function(message) {
    var cmd = (message ? message.cmd : '');
    if ('run' === cmd) {
      this.init(message);
      this.connect();
    } else if ('abort' === cmd) {
      this.agentErrror_ = this.agentError_ || (new Error('abort'));
      this.done_();
    } else {
      logger.error('Unrecognized IPC command %s, message: %j', cmd, message);
    }
  }.bind(this));
};
github WPO-Foundation / webpagetest / agent / js / src / wd_utils.js View on Github external
child_process.exec(command, function(error, stdout, stderr) {
    if (error !== system_commands.get('command not found')) {
      callback(stdout, stderr);
    } else if (errback) {
      errback(error, stdout, stderr);
    } else {
      logger.error(
          'Command %s failed with error %s stdout:\n%s\nstderr:\n%s',
          command, error, stdout, stderr);
    }
  });
};
github WPO-Foundation / webpagetest / agent / js / src / wpt_client.js View on Github external
Client.prototype.abortJob_ = function(job) {
  'use strict';
  logger.error('Aborting job %s: %s%s', job.id, (job.testError || ''),
      (job.testError && job.agentError ? ' ' : ''),
      (job.agentError ? '(' + job.agentError + ')' : ''));
  if (this.onAbortJob) {
    this.onAbortJob(job);
  } else {
    job.runFinished(/*isRunFinished=*/true);
  }
};
github Tencent / TSW / bin / tsw / util / network.js View on Github external
fs.readFile('/proc/net/dev', function(err, buffer) {

        if (err) {
            logger.error(err.stack);
            return;
        }

        const lines = buffer.toString('UTF-8').split('\n');
        const sum = createEmpty();
        const incr = createEmpty();
        const curr = createEmpty();

        lines.forEach((v, i) => {
            const tmp = v.split(/\W+/);

            if (!tmp[1]) {
                return;
            }

            const key = tmp[1];
github LockerProject / Locker / migrations / 0000000000008.js View on Github external
request.get({uri:config.lockerBase + '/Me/contacts/update'}, function(err, resp, body) {
            if(err || resp.statusCode !== 200) {
                logger.error("failed to call contacts update "+(err||resp.statusCode));
                callback(false);
            }
            request.get({uri:config.lockerBase + '/Me/twitter/run?id=friends'}, function(err, resp, body) {
                if(err || resp.statusCode !== 200) {
                    logger.error("failed to call twitter run "+(err||resp.statusCode));
                    callback(false);
                }
                callback(true);
            })
        });
    });
github LockerProject / Locker / migrations / 0000000000007.js View on Github external
request.get({uri:config.lockerBase + '/Me/contacts/update'}, function(err, resp, body) {
      if ((err || resp.statusCode !== 200) && body !== "already running") {
         if (resp && resp.statusCode !== 200)
            logger.error("couldn't update contacts, response: " + body);

         if (err)
            logger.error(new Error(err).stack);

         return callback(false);
      }

      callback(true);
   });
};
github LockerProject / Locker / migrations / 0000000000006.js View on Github external
request.get({uri:config.lockerBase + '/Me/github/run?id=repos'}, function(err, resp, body) {
            if(err || resp.statusCode !== 200) {
                if (resp.statusCode !== 200) logger.error("couldn't pull GitHub repos, response from connector: " + body);
                if (err) logger.error(new Error(err).stack);
                return callback(false);
            }
            callback(true);
        });
    });
github LockerProject / Locker / Common / node / lcrypto.js View on Github external
exports.encrypt = function(data) {
    if (!data) {
        logger.error("Error encrypting " + data);
        return "";
    }
    var cipher = crypto.createCipher("aes192", symKey);
    var ret = cipher.update(data, "utf8", "hex");
    ret += cipher.final("hex");
    return ret;
}

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