UNPKG

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

15 lines (11 loc) 302 B
let context = {}; function setContext(newContext) { context = { ...context, ...newContext }; } function logWithContext(level, message) { console.log(`[${level.toUpperCase()}] ${JSON.stringify(context)} - ${message}`); } module.exports = { setContext, logWithContext };