npm.io
3.1.2 • Published 6 years ago

3h-log

Licence
MIT
Version
3.1.2
Deps
1
Size
6 kB
Vulns
0
Weekly
0
Stars
1

3h-log

A logger lib.

Features

  • Log with formatted time stamps (using 3h-time)
  • Log with various prefixes
  • Log level control

Example


const Logger = require('3h-log'),
    logger = new Logger({ timeFormat: '[YYYY-MM-DD HH:mm:SS.sss]' });

logger.print('custom', 'Custom messages.');

logger.setLevel('log');

logger.error('Some errors.');
logger.warn('Some warnings.');
logger.info('Some infomation.');
logger.log('Some logs.');
logger.debug('This should not be seen!');

APIs

Just read the type declaration files in typings to learn the APIs.

Keywords