Configure once, log everywhere — a lightweight colored logger for Node.js with full TypeScript support.
Most logging libraries are heavy, complex, and need config files just to get colored output. logpaint does it in one line.
| Feature | logpaint | chalk | winston | pino |
|---|---|---|---|---|
| Zero dependencies | ✓ | ✓ | ✕ | ✕ |
| Built-in log levels | ✓ | ✕ | ✓ | ✓ |
| Custom levels (typed) | ✓ | ✕ | ✓ | ✕ |
| Level filtering | ✓ | ✕ | ✓ | ✓ |
| Runtime level switching | ✓ | ✕ | ✓ | ✕ |
| TypeScript generics | ✓ | ✓ | ✕ | ✓ |
| ESM + CJS | ✓ | ✓ | ✓ | ✓ |
Built for developers who want beautiful logs without the bloat.
Pure JavaScript using native Node.js APIs. No bloat, no supply chain risk. Just install and go.
Full IntelliSense for custom levels. Generics ensure your custom log methods are fully typed.
Add your own levels like http or db with
custom colors, prefixes, and priorities.
Enable with a single flag. Each log line gets a clean
YYYY-MM-DD HH:MM:SS prefix.
Set minLevel to suppress low-priority logs. Show only
warnings and errors in production.
Change log level on the fly with setLevel(). No restart
needed. Perfect for debugging.
From zero-config to fully customized — in just a few lines.
import { createLogger } from 'logpaint'; const log = createLogger(); log.debug('Request payload: { id: 42 }'); log.info('Server started on port 3000'); log.success('Database connected'); log.warn('Deprecated API endpoint used'); log.error('Failed to read config file');
import { createLogger } from 'logpaint'; const log = createLogger({ timestamp: true }); log.info('Request received'); log.success('Response sent in 42ms'); log.error('Connection timeout'); // Output: // 2026-02-22 10:30:45 [INFO] Request received // 2026-02-22 10:30:45 [SUCCESS] Response sent in 42ms // 2026-02-22 10:30:45 [ERROR] Connection timeout
import { createLogger } from 'logpaint'; const log = createLogger({ timestamp: true, levels: { http: { color: 'brightBlue' }, db: { color: 'brightMagenta', prefix: 'DATABASE' }, }, }); log.http('GET /api/users 200 OK'); log.db('Query executed in 12ms'); log.info('Default levels still work');
import { createLogger } from 'logpaint'; const log = createLogger({ minLevel: 'warn' }); log.debug('Hidden'); // suppressed (priority 0) log.info('Hidden'); // suppressed (priority 1) log.warn('Visible'); // shown (priority 2) log.error('Visible'); // shown (priority 3) // Switch at runtime — no restart needed log.setLevel('debug'); log.debug('Now visible!');
const { createLogger } = require('logpaint'); const log = createLogger({ timestamp: true }); log.info('Works with require() too'); log.success('CJS + ESM — your choice');
Returns a logger with methods for every level — built-in and custom.
| Option | Type | Default | Description |
|---|---|---|---|
timestamp |
boolean |
false |
Prepend timestamp to each log line |
minLevel |
string |
undefined |
Minimum priority level to display |
levels |
Record<string, ANSIColor | LevelConfig>
|
undefined |
Custom levels to add alongside built-ins |
| Field | Type | Default | Description |
|---|---|---|---|
color |
ANSIColor |
required | ANSI color name for this level |
prefix |
string |
level name (uppercase) | Label shown in brackets, e.g. [DATABASE] |
priority |
number |
1 |
Priority for filtering with minLevel |
| Level | Color | Priority |
|---|---|---|
debug |
magenta | 0 |
info |
cyan | 1 |
success |
green | 1 |
warn |
yellow | 2 |
error |
red | 3 |
| Method | Description |
|---|---|
log.debug(...args) |
Log at debug level (priority 0) |
log.info(...args) |
Log at info level (priority 1) |
log.success(...args) |
Log at success level (priority 1) |
log.warn(...args) |
Log at warn level (priority 2) |
log.error(...args) |
Log at error level (priority 3) |
log.setLevel(level) |
Change minimum level at runtime |
| Basic Colors | Bright Colors |
|---|---|
black
|
brightBlack
|
red |
brightRed |
green |
brightGreen |
yellow |
brightYellow |
blue |
brightBlue |
magenta |
brightMagenta |
cyan |
brightCyan |
white |
brightWhite |