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 🙏

© 2025 – Pkg Stats / Ryan Hefner

custom-logging-module

v0.1.11

Published

Custom logger for typescript projects

Readme

Custom Logger Package

Overview

This Custom Logger package is designed to provide a comprehensive logging solution for Node.js applications. It supports various logging levels, customizable styling for terminal output, and a structured approach to managing main processes and subprocesses logging. It's structured to encourage modularity and ease of use, making it a suitable choice for both small and large-scale applications.

Features

  • Logging Levels: Supports multiple logging levels (e.g., TRACE, DEBUG, INFO, WARN, ERROR).
  • Styling: Customizable styling options for terminal output, including color coding, to enhance readability.
  • Main and Subprocess Management: Facilitates structured logging by distinguishing between main processes and subprocesses, enabling better traceability and organization.

To use the Custom Logger in your project, follow these steps:

Installation

First, add the Custom Logger package to your project using npm: npm install custom-logger-package-name

Usage

  • Initialize the Main Process Logger:

Before logging from any part of your application, you must initialize the Main Process Logger. This step sets up the logging service and applies the initial configuration. You can either inject logger or extend it.

import { LoggerClient, LoggerMode, MainProcessLoggerConfig, LogLevel } from "custom-logging-module";

class MyApp extends LoggerClient { constructor() { super(new MainProcessLoggerConfig("MyApp", LoggerMode.COLORED, LogLevel.INFO)); } }

const app = new MyApp(); app.log(LogLevel.INFO, "Application started.");

  • Logging from a Subprocess:

For logging in a submodule or subprocess, instantiate a LoggerClient with a SubProcessLoggerConfig. Ensure to specify the name of the main process it belongs to for proper association.

import { LoggerClient, SubProcessLoggerConfig, LogLevel } from "custom-logging-module";

class DataService extends LoggerClient { constructor(mainProcessName: string) { super(new SubProcessLoggerConfig("DataService", mainProcessName)); }

fetchData() {
    this.log(LogLevel.INFO, "Fetching data...");
    // Data fetching logic...
}

}

const dataService = new DataService("MyApp"); dataService.fetchData();

Configuration

The Custom Logger allows for detailed configuration of logging behavior and styles. Modify the logging level, mode (classic, colored, or docker), and terminal output styles using the LoggerConfig and LoggerStylesConfig classes.

Documentation

TO DO

Contributing

Contributions are welcome! If you'd like to improve the Custom Logger package, please feel free to fork the repository, make your changes, and submit a pull request.

License

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