Every log has a trail.
A lightweight, typed logging utility with a powerful lifecycle. Simple, clean, and developer‑friendly — flexible enough for production.
~6.5 KB · Zero deps · CJS + ESM
ZTracer is a tiny, typed logging utility for JavaScript and Node.js. It makes console output visually readable by grouping logs with colors and backgrounds.
More than a pretty logger. ZTracer features a log lifecycle with global, group, and per‑log callbacks — giving you full control over every log. With the right configuration, it's a lightweight, reliable solution for production as well as local development.
Not an enterprise logging system with built‑in transports. Just enough — and fully under your control.
Global → Group → Specific callbacks. Hook into every log, transform data, or send telemetry.
Assign colors and backgrounds to different categories. Instantly distinguish API from DB logs.
Measure execution time of any async/sync function with a clean, grouped timer.
Log objects and arrays as tables or expandable directories.
Full type safety with generics. Define your group names and get autocomplete.
Supports both CommonJS and ES Modules. Use it anywhere.
| Library | Size | Deps | TS | Groups | Lifecycle | Node/Browser | Best for |
|---|---|---|---|---|---|---|---|
| ZTracer | ~6.5 KB | 0 | Both | Dev logging, production with hooks | |||
console.log |
– | 0 | Both | Basic output | |||
debug |
~12 KB | 0 | Node | Namespace logging | |||
pino |
~30 KB | few | Node | Production JSON logging | |||
winston |
~150 KB | many | Node | Enterprise logging |