Skip to content
Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

209 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ 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

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

pull request

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages