superloggix
v1.0.2
Published
✨ A modern, colorful, and developer-friendly logger for Node.js — featuring i18n, smart stack traces, and CLI formatting helpers.
Maintainers
Readme
🧦 SuperLoggix
A beautiful, structured, multilingual, developer-friendly logger — powered by Winston & Chalk
SuperLoggix is not your average
console.log. It’s a modern, human-readable logger with colorful output, intelligent stack-traces, i18n support, and helper methods for structured terminal UIs and statistics.
🚀 Features
- ⚡ Plug-and-play setup – instant defaults, zero boilerplate.
- 💤 Lazy initialization – no file I/O until your first log.
- 🌍 Multi-language support (i18n) – override or add your own translations.
- 🧠 Smart stack traces – colorized, clean, clickable file paths.
- 🎨 Pretty error formatting – readable error messages with stack line context.
- 🧩 Multiple loggers – create isolated instances with their own prefixes & configs.
- 🛡️ Process-level safety – logs unhandled rejections & uncaught exceptions gracefully.
- 💾 File + console transports – configurable and toggleable at runtime.
- 🧰 Advanced helpers –
printTitle(),printStat(),printSeparator(), etc. for CLI dashboards.
🧹 Installation
npm install superloggix
# or
yarn add superloggix⚡ Quick Start
import { logger } from 'superloggix';
logger.setOptions({
prefix: '[APP]',
colors: true,
files: { enabled: false }, // console only
});
logger.info('Application started');
logger.warn('Memory usage is getting high');
logger.error('Something broke badly');Output:
INFO: [APP] Application started
WARN: [APP] Memory usage is getting high
ERREUR: Something broke badly
→ 1. main | app.ts line 42 (/src/app.ts:42)🌐 Internationalization (i18n)
SuperLoggix speaks multiple languages. You can change the default locale or register your own translations at runtime:
import { setDefaultLocale, registerMessages, translate } from 'superloggix/i18n';
setDefaultLocale('fr');
registerMessages('fr', {
errorTitle: 'ERREUR (FR)',
uncaughtException: 'Erreur non gérée (FR)',
unhandledRejection: 'Promesse rejetée non gérée (FR)',
line: 'ligne',
});
console.log(translate('uncaughtException')); // → "Erreur non gérée (FR)"🧠 Multiple Logger Instances
import { createLogger } from 'superloggix';
const coreLogger = createLogger({
prefix: '[CORE]',
colors: true,
files: { enabled: false },
});
const apiLogger = createLogger({
prefix: '[API]',
colors: true,
files: { enabled: true, combinedFile: 'api.log' },
});
coreLogger.info('Core system initialized');
apiLogger.error('Request failed', { error: new Error('HTTP 500') });🧦 CLI Styling Helpers
SuperLoggix is perfect for CLI apps, bots, and build tools.
logger.printTitle('System Diagnostics');
logger.printStatCategory('Performance');
logger.printStat('CPU usage', '43%');
logger.printStat('RAM usage', '1.3 GB');
logger.printSeparator('double');Output:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
System Diagnostics
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━━━━━━━━━━ Performance ━━━━━━━━━━
• CPU usage : 43%
• RAM usage : 1.3 GB
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━💥 Error Handling & Stack Traces
Automatically catches:
- Uncaught exceptions
- Unhandled promise rejections
throw new Error('Database connection failed');Output:
[10/5/2025 13:48:17] ERREUR: Database connection failed
→ 1. connectDB | db.ts line 24 (/src/db.ts:24)
→ 2. main | index.ts line 8 (/src/index.ts:8)🔧 Customization Options
| Option | Description | Default |
| ---------------------------- | ---------------------------------------------------- | -------- |
| level | Minimum log level (info, debug, warn, error) | info |
| prefix | Text prefix for all log messages | '' |
| colors | Enable/disable ANSI colors | true |
| logsDir | Directory for file outputs | ./logs |
| console.enabled | Enable console output | true |
| files.enabled | Enable file outputs | true |
| process.exitOnProcessError | Exit process on unhandled errors | true |
🧪 Development Example
See src/dev.ts for a full live demo:
npx ts-node src/dev.tsIt demonstrates:
- Dynamic locale overrides (
registerMessages) - Process error handling
- Helper UI methods (
printTitle,printStat, etc.) - Pretty stack traces
❤️ Why developers love SuperLoggix
“Finally, a logger that outputs something I actually want to read.” “The prettiest stack traces I’ve ever seen in Node.” “Makes my CLI tools feel professional.”
📦 License
MIT © 2025 Matt' — Gitlab
