Skip to content

log-wiz

Ultra-lightweight Node.js & Browser logger. Auto PII masking. Zero dependencies. < 1.5 KB gzipped.
terminal
$ npm install @gouranga_samrat/log-wiz
> import { wiz } from "@gouranga_samrat/log-wiz"
> wiz.info("Server started", { meta: { port: 3000 } })
INF 2024-05-15 14:32:01.123 Server started port=3000
> wiz.warn("High memory", { meta: { password: "secret" } })
WRN 2024-05-15 14:32:02.456 High memory password=[MASKED]
> wiz.error("DB failed", { error: new Error("ECONNREFUSED") })
ERR 2024-05-15 14:32:03.789 DB failed
Error: ECONNREFUSED
at connect (src/db/client.ts:22:9)

Zero Dependencies

No chalk, no moment, no lodash. Pure native APIs — ANSI codes for colours, built-in Date for timestamps. Nothing extra in node_modules.

Auto PII Masking

Recursively scans every metadata object. password, token, secret, authorization, cookie, card_number and more are replaced with [MASKED] before any output.

Environment Smart

Pretty ANSI in development. Compact JSON in production. Grouped DevTools in the browser. Auto-detected — zero config.

TypeScript First

Written entirely in TypeScript. Full IntelliSense for every config option, log entry field, and method parameter.

Daily File Rotation

Stream-based writes via fs.createWriteStream. Daily archives, configurable retention, automatic pruning. Non-blocking.

Multi-Instance

new Wiz({ scope: 'database' }) — independent level, masked keys, transports, and correlation ID per instance.

Featurelog-wizwinstonpino
Zero runtime dependencies
Auto PII masking
Browser-native (< 1.5 KB)⚠️
Circular-reference safe⚠️
Parsed stack traces⚠️
Multi-instance + scoped
Built-in daily rotationplugin
No-op mode (zero overhead)⚠️⚠️
Tree-shakable