1.0.3 • Published 10 months ago

@alihussnain101/core_logger v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

Rust Node Logger

A high-performance Node.js logger implemented in Rust using Neon bindings.

Installation

npm install @alihussnain101/core_logger

Prerequisites

  • Node.js >=14.0.0
  • Rust toolchain (for compilation)
  • cargo (Rust package manager)

Usage

const Logger = require("@alihussnain101/core_logger");

// Initialize logger
const logger = new Logger({
  logPath: "app.log",
  minLevel: "INFO",
  metadata: {
    service: "user-service",
    environment: "production",
  },
});

// Log messages
logger.info("Server started", { port: 3000 });
logger.error("Database connection failed", { retryCount: 3 });
logger.debug("Processing request", { requestId: "123" });

Configuration Options

OptionTypeDefaultDescription
logPathstring'app.log'Path to the log file
minLevelstring'INFO'Minimum log level ('ERROR', 'WARN', 'INFO', 'DEBUG', 'TRACE')
metadataobject{}Default metadata to include in all log entries

Log Levels

  • ERROR: Error conditions
  • WARN: Warning conditions
  • INFO: Informational messages
  • DEBUG: Debug messages
  • TRACE: Trace messages

Performance

This logger is implemented in Rust for high performance. It uses asynchronous I/O and efficient memory management.

1.0.3

10 months ago

1.0.2

10 months ago