serverless-local
Version:
A serverless framework plugin for running your serverless stack locally.
31 lines (30 loc) • 1.03 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const chalk_1 = __importDefault(require("chalk"));
class Logger {
static log(msg, ...params) {
console.log(`${chalk_1.default.green("[local]:")} ${msg}`, ...params);
}
static logClear(msg, ...params) {
this.clear();
this.log(msg, ...params);
}
static debug(msg, ...params) {
if (typeof process.env.SLS_DEBUG !== "undefined")
console.log(`${chalk_1.default.yellow("[local]:")} ${msg}`, ...params);
}
static debugClear(msg, ...params) {
this.clear();
this.debug(msg, ...params);
}
static clear() {
if (process.stdout && process.stdout.clearLine)
process.stdout.clearLine(0);
if (process.stdout && process.stdout.cursorTo)
process.stdout.cursorTo(0);
}
}
exports.default = Logger;