Why developers love MagicLogger
Everything you need to debug faster, understand deeper, and ship with confidence
Beautiful by Default
Turn your console into a work of art. Automatic colors, emojis, tables, and formatting that makes debugging a joy.
logger.info('๐ <rainbow>');
logger.table(data);
logger.progressBar(0.75);
Async by Default
Non-blocking async logging for responsive applications. Optimized for visual clarity, not just speed. Sync mode available when needed.
MAGIC Schema
Universal style preservation with our MAGIC schema. Maintain consistent formatting across all transports.
Ship Anywhere
One logger, infinite destinations. From console to cloud, we support all major transports.
Production Ready
Built-in extensions for rate limiting, sampling, redaction, and queue management. Focus on reliability and maintainability.
Works Everywhere
Same API for Node.js, browsers, and all JavaScript environments. The only production logger with full browser support.
OpenTelemetry Support
Native OpenTelemetry integration for distributed tracing and observability.
Flexible Architecture
Extensible design with custom transports, formatters, and processors.
TypeScript First
100% TypeScript with full type safety and enforced 70%+ unit test coverage in CI/CD.
Architectural Diagram
Worker thread architecture โข Smart batching โข Minimal dependencies โข Tree-shakeable
Logger Core
Lightweight routing layer that directs logs to transports efficiently
// Logger core - lightweight orchestration
class Logger {
constructor(options?: LoggerOptions) {
this.id = options?.id || this.generateId();
this.transports = options?.transports || [];
this.context = options?.context || {};
this.tags = options?.tags || [];
}
log(level: LogLevel, message: string, meta?: any): void {
const entry = this.createEntry(level, message, meta);
this.dispatch(entry);
}
private dispatch(entry: LogEntry): void {
this.transports.forEach(transport => {
if (transport.shouldLog?.(entry) ?? true) {
transport.log(entry);
}
});
}
}
Performance that matters
Benchmarked against the best, optimized for real-world use
Styled Output Performance
Real-world performance with file I/O (20K iterations)
Sync vs Async: Choose Your Speed
Plain text logging? Use SyncLogger for 250K+ ops/sec - the fastest option when you don't need styling.
Styled output? AsyncLogger delivers 120K+ ops/sec with styles - 50% faster than sync mode for styled logs. Why? Async mode uses pre-compiled style caching and non-blocking I/O, reducing style processing overhead from from over 40% to just 11.8%. Learn about our performance architecture โ
Non-Blocking
True async architecture with 0.004ms P50 blocking keeps your event loop responsive
Pre-Compiled Styles
Styles are compiled at logger creation for minimal runtime overhead
Smart Batching
Automatic batching for network transports, immediate dispatch for files
Real code, real examples
From quick prototypes to production systems - see how MagicLogger scales with you
๐ฏBasic Usage
Get started in seconds. No config needed.
import { Logger } from 'magiclogger';
const logger = new Logger();
// Beautiful logs with angle bracket syntax
logger.info('<cyan.bold>Server started</> on port <yellow>3000</>');
logger.warn('<yellow>โ </> Memory usage <red.bold>high</>', { usage: '85%' });
logger.error('Connection failed', new Error('ECONNREFUSED'));
// The MAGIC Schema preserves your styles everywhere
logger.success('<green>โ
All tests passed!</>');
logger.header('Application Metrics', ['cyan', 'bold']);
// Rich formatting with real data
logger.table([
{ endpoint: '/api/users', requests: 12847, avg_ms: 45, p99_ms: 142 },
{ endpoint: '/api/posts', requests: 8432, avg_ms: 23, p99_ms: 87 },
{ endpoint: '/api/auth', requests: 3251, avg_ms: 112, p99_ms: 428 }
]);
// Progress tracking
logger.progress(0.75, 'Processing: 75% complete');
Ready to transform your debugging experience?
Join thousands of developers who've made their logs beautiful, meaningful, and actually useful.