How to use the winston.error function in winston

To help you get started, we’ve selected a few winston 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 NodeBB / NodeBB / src / install.js View on Github external
}

	if (ciVals && ciVals instanceof Object) {
		if (ciVals.hasOwnProperty('host') && ciVals.hasOwnProperty('port') && ciVals.hasOwnProperty('database')) {
			install.ciVals = ciVals;
			next();
		} else {
			winston.error('Required values are missing for automated CI integration:');
			if (!ciVals.hasOwnProperty('host')) {
				winston.error('  host');
			}
			if (!ciVals.hasOwnProperty('port')) {
				winston.error('  port');
			}
			if (!ciVals.hasOwnProperty('database')) {
				winston.error('  database');
			}

			process.exit();
		}
	} else {
		next();
	}
}
github google / shipshape / shipshape / contrib / phabricator / server.js View on Github external
function analysisFailureHandler(error, value) {
  winston.error("Analysis of revision " + value.revisionID +
      ", diff " + value.diffID + " failed: " + error);

  conduitInstance.differentialCreateComment(
    value.revisionID, "Shipshape analysis failed: " + error, "comment",
    false, true, function(error) {
      if (error !== undefined) {
        winston.error("unable to report error message as comment to " +
            "Phabricator in analysis failure handler: " + error);
      }
      conduitInstance.harbormasterSendMessage(value.PHID, "fail",
        function(error) {
          if (error !== undefined) {
            winston.error("unable to report error build status to " +
                " Phabricator in analysis failure handler: " + error);
          }
        });
github zalando-stups / yourturn / server / src / routes / user.js View on Github external
.catch(err => {
            winston.error('Could not GET /teams?member=%s: %d %s', req.params.userId, err.status || 0, err.message);
            return res.status(err.status || 0).send(err);
        });
}
github Chabane / bigdata-playground / webapp / server / src / kafka / tweet.consumer.ts View on Github external
this.consumer.on('error', (error) => {
            winston.error('Tweet Kafka Consumer - error > ', error);
        });
        this.consumer.on('message', (message: any) => {
github NodeBB / NodeBB / src / database / level.js View on Github external
db.on('error', function (err) {
			winston.error(err.stack);
		});
github Azure / azure-functions-pack / src / main.ts View on Github external
let projectRootPath = "";
    try {
        projectRootPath = name ?
            path.resolve(process.cwd(), name) : process.cwd();
    } catch (error) {
        winston.error(error);
        throw new Error("Could not determine route");
    }

    let outputPath = ".funcpack";
    try {
        if (options.output) {
            outputPath = path.join(options.output, outputPath);
        }
    } catch (e) {
        winston.error(e);
        throw new Error("Could not parse the output option");
    }

    winston.info("Unpacking project at: " + projectRootPath);
    await Unpacker.unpack({ projectRootPath, outputPath });
    winston.info("Complete!");
}
github acm309 / PutongOJ / data / RanklistUpdater / updater.js View on Github external
async function main () {
  while (1) {
    try {
      await run()
    } catch (e) {
      logger.error(e)
    }
  }
}
github cdnexperts / cdnselector / libs / routes / cdns.js View on Github external
cdnDao.del(req.params.id, function (err) {
            if (!err) {
                res.writeHead(204);
                res.end();
            } else {
                res.writeHead(err.status_code || 500, { 'Content-Type': 'text/plain'});
                res.end('Error deleting cdn');
                logger.error('Error while deleting cdn', err);
            }
        });
    });