3h-log
TypeScript icon, indicating that this package has built-in type declarations

3.1.2 • Public • Published

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.

Package Sidebar

Install

npm i 3h-log

Weekly Downloads

45

Version

3.1.2

License

MIT

Unpacked Size

5.77 kB

Total Files

5

Last publish

Collaborators

  • 3h