@fonos/logger
Advanced tools
Comparing version 0.0.87 to 0.0.88
@@ -1,2 +0,2 @@ | ||
import logger, {mute} from "./logger"; | ||
export {logger as default, mute}; | ||
import logger, { mute } from "./logger"; | ||
export { logger as default, mute }; |
"use strict"; | ||
var __createBinding = | ||
(this && this.__createBinding) || | ||
(Object.create | ||
? function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { | ||
enumerable: true, | ||
get: function () { | ||
return m[k]; | ||
} | ||
}); | ||
} | ||
: function (o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
}); | ||
var __setModuleDefault = | ||
(this && this.__setModuleDefault) || | ||
(Object.create | ||
? function (o, v) { | ||
Object.defineProperty(o, "default", {enumerable: true, value: v}); | ||
} | ||
: function (o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = | ||
(this && this.__importStar) || | ||
function (mod) { | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) | ||
for (var k in mod) | ||
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) | ||
__createBinding(result, mod, k); | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", {value: true}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.mute = exports.default = void 0; | ||
const logger_1 = __importStar(require("./logger")); | ||
exports.default = logger_1.default; | ||
Object.defineProperty(exports, "mute", { | ||
enumerable: true, | ||
get: function () { | ||
return logger_1.mute; | ||
} | ||
}); | ||
Object.defineProperty(exports, "mute", { enumerable: true, get: function () { return logger_1.mute; } }); |
import winston from "winston"; | ||
declare const logger: winston.Logger; | ||
declare const mute: () => void; | ||
export {logger as default, mute}; | ||
export { logger as default, mute }; |
"use strict"; | ||
var __importDefault = | ||
(this && this.__importDefault) || | ||
function (mod) { | ||
return mod && mod.__esModule ? mod : {default: mod}; | ||
}; | ||
Object.defineProperty(exports, "__esModule", {value: true}); | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.mute = exports.default = void 0; | ||
@@ -12,5 +10,3 @@ const winston_1 = __importDefault(require("winston")); | ||
const fluentTransport = fluent_logger_1.default.support.winstonTransport(); | ||
const fluent = new fluentTransport( | ||
`${process.env.LOG_OPT_TAG_PREFIX}.${process.env.COMPOSE_PROJECT_NAME}.mediacontroller`, | ||
{ | ||
const fluent = new fluentTransport(`${process.env.LOG_OPT_TAG_PREFIX}.${process.env.COMPOSE_PROJECT_NAME}.mediacontroller`, { | ||
host: process.env.LOGS_DRIVER_HOST, | ||
@@ -20,19 +16,21 @@ port: process.env.LOGS_DRIVER_PORT, | ||
requireAckResponse: true | ||
} | ||
); | ||
const transports = | ||
process.env.NODE_ENV === "dev" | ||
}); | ||
const level = process.env.NODE_ENV === "dev" ? "debug" : "info"; | ||
const transports = process.env.NODE_ENV === "dev" | ||
? [new winston_1.default.transports.Console()] | ||
: [fluent]; | ||
const format = process.env.NODE_ENV === "dev" | ||
? winston_1.default.format.simple() | ||
: winston_1.default.format.json(); | ||
const logger = winston_1.default.createLogger({ | ||
level: "debug", | ||
levels: winston_1.default.config.npm.levels, | ||
format: winston_1.default.format.json(), | ||
transports | ||
format: winston_1.default.format.combine(winston_1.default.format.colorize(), format), | ||
levels: winston_1.default.config.npm.levels, | ||
transports, | ||
level | ||
}); | ||
exports.default = logger; | ||
logger.on("finish", () => { | ||
fluent.sender.end("end", {}, () => {}); | ||
fluent.sender.end("end", {}, () => { }); | ||
}); | ||
const mute = () => logger.transports.forEach((t) => (t.silent = true)); | ||
exports.mute = mute; |
{ | ||
"name": "@fonos/logger", | ||
"version": "0.0.87", | ||
"version": "0.0.88", | ||
"description": "Logger module", | ||
@@ -36,7 +36,5 @@ "author": "Pedro Sanders <psanders@fonoster.com>", | ||
"devDependencies": { | ||
"dotenv": "^8.2.0", | ||
"rimraf": "^3.0.2", | ||
"typescript": "^4.1.5" | ||
"rimraf": "^3.0.2" | ||
}, | ||
"gitHead": "f432bd97cab50bfebfe2be9847cc5e2ff890c750" | ||
"gitHead": "cb5c86eae9d3982c4ec62d0faa33c085eb9141e8" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4759
1
65
7