1.1.0 • Published 10 years ago

logmore-console v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

logmore-console

Console logs processor for logmore

Installation

$ npm install logmore-console

Usage

logmore-console is a logs processor for logmore.

var http = require('http');
var logmore = require('logmore');
logmore.use(require('logmore-console')());

var logger = logmore('http');
logmore.enable('http', 'info');

http.createServer(function (req, res) {
  logger.debug(req.method + ' ' + req.url);
  res.end('Hello world !\n');
}).listen(1337, '127.0.0.1');
logger.info('Server running at http://127.0.0.1:1337');

Configuration

You can configure the processor :

logmore.use(require('logmore-console')({
  indent: 2,
  colors: false,
  momentFormat: 'HH:mm:ss Z'
}));
  • indent {number} indentation of the rendered log
  • colors {boolean} use colors or not
  • momentFormat {string} date printing format (uses moment library)
1.1.0

10 years ago

1.0.0

10 years ago