A minimal, flexible logger for Node with console and file output, ANSI colors, and daily rotation.
bun add @atums/echoimport { 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" });trace | debug | info | warn | error | fatal
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"]
}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
}-
- Configuration Guide - Complete config options, environment variables, and patterns
- 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
.jsonlfiles 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