ulekh
v0.1.1
Published
Loggin library for node.js
Downloads
1
Maintainers
Readme
ਉੱਲੇਖ (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: '[email protected]' });
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: '[email protected]' });
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