@markox36/logger
v1.0.6
Published
Lightweight, customizable and colorized logger for Node.js
Readme
@markox/logger
A lightweight, customizable and colorized logger for Node.js.
Features
- No environment variables required
- Fully customizable colors
- File logging support
- TypeScript first
- Callsite detection
Installation
npm install @markox/logger
pnpm add @markox/logger
yarn add @markox/loggerimport { createLogger } from "@markox/logger";
const logger = createLogger({
types: {
API: "#42a5f5",
DB: "#4caf50",
AUTH: "#ab47bc",
},
debug: true, // Set to true to get .debug() logs
logDir: "./logs", // Route to logs folder
logToFile: false, // Set to true to get file logs
});
logger.info("API", "Servidor iniciado");
logger.info("DB", "Conectado");
logger.info("AUTH", "hola");
logger.debug("API", "Request recibida", { endpoint: "/users" });
logger.warn("DB", "Consulta lenta detectada");
logger.error("AUTH", "Fallo de autenticación", { userId: 12345 });Made by Markox
