JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 95
  • Score
    100M100P100Q39514F
  • License MIT

A logger lib.

Package Exports

  • 3h-log

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (3h-log) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.