rhyno
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Lightweight, efficient and modern logger made with TypeScript.


Installation

$ npm install rhyno --save

Usage

import { Logger, Level, Transport } from 'rhyno'

const logger = new Logger({
    transports: [
        new Transport({
            level: new Level({
                name: 'test',
                color: 'CYAN',
                format: '{{color}}[ {{prefix}} ] {{reset_color}}({{time}}) {{message}}',
                time: {
                    format: 'DD/MM/YYYY HH:mm:ss',
                    locale: 'es'
                }
            })
        })
    ]
})

logger.log({
    level: 'test',
    message: 'Hi, this is a test using Rhyno!'
})

The output will be:

[ test ] (19/02/2021 19:32) Hi, this a test using Rhyno!

Any format is allowed:

[ test ] (20/03/2022 15:23) Hi, this a test using Rhyno!

You can also log without date (first delete the placeholder on format):

[ test ] Hi, this a test using Rhyno!

/rhyno/

    Package Sidebar

    Install

    npm i rhyno

    Weekly Downloads

    2

    Version

    0.1.0

    License

    Apache-2.0

    Unpacked Size

    21.5 kB

    Total Files

    24

    Last publish

    Collaborators

    • aidakkk