本文整理匯總了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) => {