@ntf/logger
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@ntf/logger

Another console logger library

Why

Because I like reinventing the wheel :)

Installation

Use your favourite package manager, idk

npm install @ntf/logger
yarn add @ntf/logger
pnpm install @ntf/logger

Usage

Importing

This library can be used in CommonJS and ESModule environments

const { ... } = require("@ntf/logger");
import { ... } from "@ntf/logger";

For NodeJS

For NodeJS there's AnsiLogger class which you can guess, uses escaped ansi code for colors in termnial/console/command prompt/whatever terminal name

For Browser

For Browser there's CSSLogger class which uses the cool feature of CSS styling, you can try AnsiLogger but on some browsers it looks weird (especially Chrome)

I want to make my own Logger

Just extend the Logger class and implement print:

class MyCoolAndAwesomeLogger extends Logger
{
    // level = can be "info", "warn", "error", "debug" or "trace"
    // args = well... anything... literally
    print(level,...args)
    {
        // do some funny stuff here
    }
};

License stuff that nobody reads

Just like any Open Source Project this has a License, the MIT License

Package Sidebar

Install

npm i @ntf/logger

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

43.9 kB

Total Files

51

Last publish

Collaborators

  • n1ghtthef0x