Skip to content

Markox36/logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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/logger
import { 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors