Skip to content

dev-dami/zario

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

216 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ“ Zario

A Minimal Logging Solution for TypeScript

npm version license downloads bundle size

Japanese


Fast β€’ Lightweight β€’ Zero Dependencies β€’ TypeScript 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

bun add 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 });

Lean Import Path

If you only need the logger class, use the lightweight entrypoint to reduce bundled code:

import { Logger } from "zario/logger";

zario/logger exports only Logger and related logger types. If you use retryOptions from this entrypoint, set Logger.retryTransportFactory with RetryTransport once at startup.

πŸ“˜ 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 12