@russ-b/nestjs-common-tools
Version:
NestJS utility tools
22 lines • 804 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.NestTransportFactory = void 0;
const winston_1 = require("winston");
const nest_winston_1 = require("nest-winston");
class NestTransportFactory {
constructor(level, appName = 'app') {
this.level = level;
this.appName = appName;
}
createTransport() {
return new winston_1.transports.Console({
level: this.level,
format: winston_1.format.combine(winston_1.format.timestamp(), winston_1.format.ms(), nest_winston_1.utilities.format.nestLike(this.appName, {
colors: true,
prettyPrint: true,
})),
});
}
}
exports.NestTransportFactory = NestTransportFactory;
//# sourceMappingURL=nest.transport-factory.js.map