log-mate
Version:
log-mate makes logging effortless & powerful—log to console, files, databases, or cloud with structured logs, encryption, real-time streaming, and auto-rotation. It’s plug & play, supports multi-transport logging, and boosts performance with async, lazy l
13 lines (10 loc) • 322 B
JavaScript
let consoleEnabled = true;
function toConsole(enable = true) {
consoleEnabled = enable;
}
function logToConsole(level, message, ...args) {
if (consoleEnabled) {
console.log(`[${level}] ${new Date().toISOString()} - ${message}`, ...args);
}
}
module.exports = { toConsole, logToConsole };