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

@gameland-team/tslogging

v1.2.3-jstest8-fix

Published

A custom logging system made in TS

Downloads

4

Readme

tslogging: A custom lightweight logger made in TypeScript

Welcome to tslogging repository!

tslogging aims to be as lightweight as possible while being as feature-rich as possible. tslogging has 5 logging levels: Info, Warn, Error, Fatal and Debug, which can be turned off at any time. There are also some additional logging types (Grouping, etc. (more to be implemented)). You can turn off warning messages while keeping info on, and more. Also, tslogging has been fixed and is currently working as a bare bones logging system, and is quite configurable.

Now supports stdout printing instead of using console to print line for all logging levels!

(tslogging is currently using JavaScript by compiling with tsc. Please tell us if any bugs arise!)

Usage

First, import the project and initialize Logger with:

const logger = new Logger(); // Logger w/ default options

// Logger with custom options
const logger = new Logger({
    "prefix": (Your desired prefix here),
    "showDate": (true/false),
    "showTime": (true/false),
    "useStdoutInstead": (true/false),
    "loggingLevel": {
        "info": (true/false),
        "debug": (true/false),
        "warn": (true/false),
        "error": (true/false),
        "fatal": (true/false),
        "group": (true/false)
    }
}); 

Now, you can use your freshly initialized Logger.

logger.info("Should be printing out a line");

This will print out a line of

[MM-dd-yyyy hh:mm:ss] Test Logger | INFO > Should be printing out a line

Outputting

Given the code below with all the logging levels ; You can see what the output is below the code.

const logger = new Logger({
    "showTime": true,
    "showDate": false,
    "prefix": "Test logger"
});

// Information output
logger.info("This is info!");

// For debugging purposes
logger.debug("This is just a random debug.");

// Just for warning something
logger.warn("It's yellow because it's a warning!");

// Error and fatal specifically. Not for printing messages, though, but instead, errors.
try {
    throw new Error('A test error!')
} catch (err) {
    logger.error(err);
    logger.fatal(err);
}

logger.group("Test group", ["The first element!"]);

Here is the output (hh:mm:ss is the time and directories removed in stacktracing on the README, so if you execute logger.error/fatal, it should show the directories):

[hh:mm:ss] Test logger | INFO > This is info!
[hh:mm:ss] Test logger | DEBUG > This is just a random debug.
[hh:mm:ss] Test logger | WARN > It's yellow because it's a warning!
[hh:mm:ss] Test logger | ERROR > Error: A test error!
    at Object.<anonymous> 
    at Module._compile 
    at Module.m._compile 
    at Module._extensions..js 
    at Object.require.extensions.<computed> [as .ts]
    at Module.load
    at Function.Module._load
    at Function.executeUserEntryPoint [as runMain] 
    at main 
    at Object.<anonymous>
[hh:mm:ss] Test logger | FATAL > Error: A test error!
    at Object.<anonymous> 
    at Module._compile 
    at Module.m._compile 
    at Module._extensions..js
    at Object.require.extensions.<computed> [as .ts]
    at Module.load 
    at Function.Module._load
    at Function.executeUserEntryPoint [as runMain] 
    at main 
    at Object.<anonymous> 
[hh:mm:ss] Test logger | GROUP > Elements for group Test group:
Test group | The first element!
[hh:mm:ss] Test logger | GROUP > End of group.

Custom colored output

Thanks to chalk, you can print out custom colored console stuff by doing so:

import { colors, Logger } from "@gameland-team/tslogging";

// const logger = ... (initialize logger here)

logger.info(colors.red("This is a log with red color"))

And it should print out a line of information with the message "This is a log with red color" in the color red.

(If you want to visit the chalk npm page, click here).

Dependencies/Dependents

You can find all the dependencies used by tslogging on the Dependencies tab. If you are looking for tslogging dependents instead, you can go on the Dependents tab.