Fast • Simple • Zero Dependencies • TypeScript Native
⚡ Quick Start · 📖 Documentation · 🤝 Contributing
- Zero dependencies — nothing to install, nothing to break
- Simple API —
logger.info(),logger.warn(),logger.error() - Flexible formatting — plain text or structured JSON
- Multiple transports — Console, File (rotation + compression), HTTP (with retry)
- Child loggers — scoped logging for modules or requests
- Async mode — non-blocking writes for high-throughput apps
- Customizable — custom log levels, colors, and filters
npm install zarioimport { Logger, ConsoleTransport } from "zario";
const logger = new Logger({
level: "info",
colorize: true,
transports: [new ConsoleTransport()],
prefix: "[MyApp]",
});
logger.info("Server started on port 3000");
logger.warn("High memory usage detected");
logger.error("Database connection failed", { code: 500 });const requestLogger = logger.createChild({
context: { scope: "request" },
});
requestLogger.info("Incoming request");import { Logger, ConsoleTransport } from "zario";
const jsonLogger = new Logger({
json: true,
transports: [new ConsoleTransport()],
});import { Logger, FileTransport } from "zario";
const logger = new Logger({
transports: [
new FileTransport({
path: "./logs/app.log",
maxSize: 10 * 1024 * 1024,
maxFiles: 5,
}),
],
});If you only need the core logger:
import { Logger } from "zario/logger";| Section | Description |
|---|---|
| Configuration | Logger options, custom levels, and colors |
| API Reference | Logger class and utilities |
| Transports | Console, File, HTTP, CircuitBreaker, DeadLetterQueue |
| Advanced Usage | Filters, enrichers, aggregators, async mode |
| Log Formats | Text and JSON output spec |
| Benchmarks | Performance comparison with other libraries |
| Roadmap | Future plans |
Bug reports, feature requests, and pull requests welcome. See Contributing Guide.
⭐ Star this repository if you find it useful
