bole-console

Console formatter for the bole logger

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
bole-console
200.1.109 years ago9 years agoMinified + gzip package size for bole-console in KB

Readme

bole-console

Console formatter for the bole logger ####

!npmnpm-imagenpm-url
Plugin for the bolebole-url logger. Formats and colorizes the JSON object and prints it to the stdout.
var bole = require('bole');
var boleConsole = require('bole-console');

var boleConsoleStream = boleConsole({
  timestamp: true,
  requestDetails: true
});

bole.output([
  { level: 'info', stream: boleConsoleStream }
]);

var log = bole('my-module');

Some outputs:
  • log.warn ({ foo: 'bar' }, 'baz')

!output1output1
  • log.error(new Error('foo'), 'bar')

!output2output2
  • log.info(request, 'foo')

!output3output3
module(options) : Writable
Returns a new Writable stream instance.
Options:
  • timestamp - Boolean
Includes the ISO string of the current time. Default false.
  • hostname - Boolean
Includes the hostname of the current user. Default false.
  • pid - Boolean
Includes the pid of the current process. Default false.
  • indent - Number
Number of spaces for each level when objects are formatted. Default 2.
  • colors - Boolean
Prints the message with colors. Default true.
  • requestDetails - Boolean
Includes some details about the request such as headers and remote socket. Default false.