npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sonic-logger

v0.0.1-beta-008

Published

A powerful, extensible TypeScript logging library for Node.js

Readme

Super Logger

A powerful, extensible TypeScript logging library for Node.js. It provides fast, non-blocking asynchronous logging with support for multiple log levels, colorized output (for development), and customizable log formatting. Perfect for production-level applications where performance matters.


Table of Contents


Installation

You can easily install Super Logger using npm or yarn.

Using npm:

npm install super-logger

Using yarn:

yarn add super-logger

Usage

Basic Usage

After installing the package, import and create a logger instance in your application.

import { SuperLogger } from 'super-logger';

// Create a new logger instance
const logger = new SuperLogger();

// Log messages with different levels
logger.info('This is an info log');
logger.error('This is an error log');
logger.warn('This is a warning log');
logger.debug('This is a debug log');
logger.trace('This is a trace log');

Log Levels

Super Logger supports the following log levels:

  • info – Informational messages
  • error – Errors and exceptions
  • warn – Warnings
  • debug – Debugging information
  • trace – Fine-grained debugging

Each log level is colorized based on its severity (in development mode), making it easy to distinguish between different types of logs.

logger.error('This is an error log'); // Red
logger.warn('This is a warning log'); // Yellow
logger.info('This is an info log'); // Green
logger.debug('This is a debug log'); // Cyan
logger.trace('This is a trace log'); // Gray

Custom Log Formatting

You can customize the log format (e.g., including timestamp, log level, and metadata).

import { SuperLogger } from 'super-logger';

const logger = new SuperLogger({
  colorize: true, // Enable colorization for development
  format: 'json', // Format logs as JSON (for structured logging)
});

logger.info('This is an info log with a custom format');

Features

  • Fast, Async Logging: Logs are processed asynchronously to avoid blocking the main thread.
  • Colorized Output: Provides colorized logs in development to easily distinguish between log levels.
  • Customizable Log Format: Customize the log format to include timestamps, log levels, and metadata.
  • File-Based Logging: Easily log to files, rotating logs by size or date to avoid memory overload.
  • Error Handling: Gracefully handles uncaught exceptions and logs errors without crashing the application.

API Reference

SuperLogger

The core class of the package.

Constructor
new SuperLogger(options: SuperLoggerOptions)

Parameters:

  • options: (Optional) Configuration options to customize the logger.
Methods
  • info(message: string): void: Logs an info level message.
  • error(message: string): void: Logs an error level message.
  • warn(message: string): void: Logs a warn level message.
  • debug(message: string): void: Logs a debug level message.
  • trace(message: string): void: Logs a trace level message.

Log Level Methods

Each log level method outputs the message to the console, with different formatting based on the severity of the log level.

  • info(message: string): Use this for informational messages.
  • error(message: string): Use this for error messages.
  • warn(message: string): Use this for warnings.
  • debug(message: string): Use this for debug information.
  • trace(message: string): Use this for fine-grained logs (usually only for debugging).

Options

SuperLoggerOptions allows you to configure the logger with various options.

interface SuperLoggerOptions {
  colorize: boolean; // Enable or disable colorized output (default: true in development)
  format: string; // Define the log format: 'default', 'json', or 'custom'
  filePath: string; // Specify the file path for log file output (optional)
}

Configuration

File Logging

You can configure Super Logger to log directly to a file, rotating logs based on size or time.

const logger = new SuperLogger({
  colorize: false, // Disable colorization in production
  filePath: '/logs/app.log', // Specify file path for logging
});

Colorization

In development, logs are colorized by default to provide clear distinctions between log levels. In production, colorization is disabled to avoid unnecessary output overhead.


License

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


Contributing

Feel free to contribute! Open an issue or submit a pull request for improvements, bug fixes, or new features.


Contact: