本文整理汇总了TypeScript中kayvee.logger类的典型用法代码示例。如果您正苦于以下问题:TypeScript logger类的具体用法?TypeScript logger怎么用?TypeScript logger使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了logger类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: require
const [, major] = process.version.match(/v(\d+)\.(\d+)\.(\d+)/);
if (+major < 5) {
console.log("\x1b[31mWARNING: YOU SHOULD BE RUNNING THIS WITH NODE >= 5!! FOUND VERSION:", process.version, "\x1b[0m");
process.exit(1);
}
var cron = require("cron");
var express = require("express");
var kayvee = require("kayvee");
var config = require("./config");
var es = require("./lib/elasticsearch");
// kayvee logger
const log = new kayvee.logger("elasticsearch-toolbox");
var app = express();
app.use(kayvee.middleware({source: "elasticsearch-toolbox"}));
app.use("/static", express.static("static"));
// elb check
app.get("/elb/check", (req, res) => {
res.status(200).end();
});
// list the indicies as a json object
app.get("/status/indices", (req, res) => {
es.get_index_shards().then((indices) => {
res.status(200).send(indices);
}).catch((err) => {
示例2:
es.update_replicas().then((replicas) => {
log.infoD("updated_replicas", {replicas});
}).catch((err) => {