Skip to content

dev-dami/zario

📝 Zario

A Minimal Logging Solution for TypeScript

npm version license downloads bundle size

Japanese


FastLightweightZero DependenciesTypeScript Native


📖 Documentation · ⚡ Quick Start · ✨ Features · 🤝 Contributing


separator


Features

  • Lightweight — minimal footprint, fast execution
  • Simple API — intuitive methods like info(), warn(), error()
  • Flexible formatting — plain text or structured JSON
  • Multiple transports — Console, File (streaming rotation), HTTP (async retry), CircuitBreaker, and DeadLetterQueue
  • Child loggers — scoped logging for modules or requests
  • Async mode — non-blocking writes for high-performance applications
  • Memory safe — bounded queues and memory-efficient streaming
  • Customizable — custom log levels, colors, and filtering

📦 Installation

npm install zario

🚀 Quick Start

import { 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 });

📘 More Examples

Child Logger

const requestLogger = logger.createChild({
  context: { scope: "request" },
});
requestLogger.info("Incoming request");

JSON Logging

import { Logger, ConsoleTransport } from "zario";

const jsonLogger = new Logger({
  json: true,
  transports: [new ConsoleTransport()],
});

File Transport

import { Logger, FileTransport } from "zario";

const logger = new Logger({
  transports: [
    new FileTransport({
      path: "./logs/app.log",
      maxSize: 10 * 1024 * 1024,
      maxFiles: 5,
    }),
  ],
});

logger.info("This log is written to a file");

📖 Documentation

Documentation:

Section Description
📘 Introduction Philosophy, core features, and common use cases.
🚀 Getting Started Detailed installation and environment auto-configuration.
⚙️ Configuration Full reference for all logger options, custom levels, and colors.
📖 API Reference Detailed API documentation for the Logger class and utilities.
📁 Transports Guide to Console, File, HTTP, CircuitBreaker, and DeadLetterQueue transports.
🧩 Advanced Usage Filters, Enrichers (Structured Logging), and Aggregators.
📊 Log Formats Specification for Text and JSON output formats.
🗺️ Roadmap Future plans and upcoming features.
📊 Benchmarks Performance comparison with other logging libraries.

🤝 Contributing

We welcome contributions! Whether it's bug reports, feature requests, or code contributions. Please see our Contributing Guide for more details.

📄 License

This project is licensed under the MIT License - see the LICENSE file for full details.


Developed for developers

⭐ Star this repository to show your support


⬆ Back to Top

About

A Minimal and Fast Logging Solution for TypeScript

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 11