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

0.1.1 • Public • Published

ਉੱਲੇਖ (ulēkha)

This package provides simple but effective logging functionality.

Note: Package is supports both esm and commonjs.

Usage

Simple usage

const { logger } = require('ulekh');
const l = logger('worker:a');

l.debug('Im %s.', 'debug');
l.log('Im %s.', 'log');
l.error('Im %s.', 'error');
l.info('Im %s.', 'info');
l.silly('Im %s.', 'silly');
l.warn('Im %s.', 'warn');
l.info('user object %o.', { name: 'Some One', email: 'someon@example.com' });

Using file adapter

const { logger, FileAdapter } = require('ulekh');
const l = logger('worker:b', {
  adapter: () => new FileAdapter()
});

l.debug('Im %s.', 'debug');
l.log('Im %s.', 'log');
l.error('Im %s.', 'error');
l.info('Im %s.', 'info');
l.silly('Im %s.', 'silly');
l.warn('Im %s.', 'warn');
l.info('user object %o.', { name: 'Some One', email: 'someon@example.com' });

TODO

  • should be able to disable loging for specific tag
  • code adapters for mysql, mongodb, http, mq, redis
  • compress old log files to save space

Dependencies (0)

    Dev Dependencies (8)

    Package Sidebar

    Install

    npm i ulekh

    Weekly Downloads

    1

    Version

    0.1.1

    License

    UNLICENSED

    Unpacked Size

    74.6 kB

    Total Files

    35

    Last publish

    Collaborators

    • bitnbytes