JSPM

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

basic logger supporting error, warning, debug and info messages with timestamp.

Package Exports

  • basic-logger

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 (basic-logger) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

logger

Basic logger for nodejs supporting error, warning, debug and info messages with timestamp. Everything you log is printed to the console.

Installation

npm install logger

Usage

var logger = require('logger');

var customConfig = {
    showMillis: true;
    stringifyJSON: false;
};

var log = new logger(customConfig)

log.info('New Info!');
log.error('An error occurred');
log.warn('I am not kidding!');
log.debug('this code is still alive...');

Config options

  • showMillis - Show the milliseconds in the timestamp
  • stringifyJSON - Apply JSON.stringify to the given message. Good to log objects or arrays.

Test

You'll need vows. Then just run npm test.

Future versions

I am willing to add support for colored log messages and allow to define a prefix which is prepended to all messages.