A minimal, flexible logger for Node
  • TypeScript 100%
Find a file
2025-10-11 14:48:48 -04:00
src no more depends :) 2025-10-11 14:43:55 -04:00
types Add performance optimizations and configuration options 2025-07-20 13:06:22 -04:00
.editorconfig first commit 2025-05-24 09:42:42 -04:00
.gitattributes first commit 2025-05-24 09:42:42 -04:00
.gitignore fix build problems, add all actual log funcs, move types 2025-05-24 13:00:32 -04:00
.gitlab-ci.yml update biome 2025-06-29 15:48:22 -04:00
biome.json update biome 2025-10-11 14:30:54 -04:00
configuration.md Add performance optimizations and configuration options 2025-07-20 13:06:22 -04:00
LICENSE first commit 2025-05-24 09:42:42 -04:00
package.json 2.0.3 2025-10-11 14:48:48 -04:00
README.md Add performance optimizations and configuration options 2025-07-20 13:06:22 -04:00
tsconfig.json redesign configuration API and documentation 2025-06-27 18:36:31 -04:00
tsup.config.ts add subDirectory option, move @ to # in relative paths, fix builder 2025-06-13 20:21:45 -04:00

@atums/echo

A minimal, flexible logger for Node with console and file output, ANSI colors, and daily rotation.

Installation

bun add @atums/echo

Quick Start

import { echo } from "@atums/echo";

// Basic logging
echo.info("App started");
echo.error("Something failed:", error, { userId: 123 });

// Multiple arguments
echo.warn("Rate limit:", 429, { endpoint: "/api/users" });

// Custom tagged logs
echo.custom("GET", "/health", { status: 200, duration: "15ms" });

Log Levels

trace | debug | info | warn | error | fatal

Output

Console:

2025-05-24 16:15:00.000 [INFO] (app.ts:3:6) Server started

File (logs/2025-05-24.jsonl):

{
  "timestamp": 1748115300000,
  "level": "info",
  "file": "app.ts",
  "line": "3",
  "data": ["Server started"]
}

Configuration

Configure via logger.json, environment variables, or constructor. See - Configuration Guide for full details.

Quick setup:

{
  "level": "debug",
  "directory": "logs",
  "console": true,
  "consoleColor": true,
  "lazyInit": true,
  "fastMode": false
}

Documentation

Features

  • Ultra-fast startup (< 50ms) with lazy initialization
  • High-performance I/O with optional console buffering
  • Multiple arguments per log call
  • Colored console output with ANSI codes
  • Daily rotated .jsonl files with automatic cleanup
  • Safe circular reference handling
  • Error object serialization
  • Custom log patterns and colors
  • Smart caller location tracking (only when needed)
  • Flexible configuration via files, environment, or constructor
  • Fast mode for maximum performance scenarios

License

BSD 3-Clause