Skip to content

mahnunchik/mag-hub

Repository files navigation

mag-hub Build Status

Mag is the streaming logger for NodeJS

mag-hub is a hub for all streams of mag logger.

If you're thinking about formatting the output messages of your application - that module is for you!

Installation

$ npm install mag-hub --save

Usage

If you require mag-hub in your application, all the logs will go through this stream.

You can make a pipe to it and format logs as you want!

var hub = require('mag-hub');

// Formatters
var info = require('mag-process-info');
var format = require('mag-format-message');
var colored = require('mag-colored-output');

hub.pipe(info())
  .pipe(format())
  .pipe(colored())
  .pipe(process.stdout);

Plugins

Plugin is the stream that transforms log object. It can change the content, add or remove fields in the log object.

Known plugins:

Output plugins

Output plugins is the stream that makes string from log object. This string can be written to a stream like process.stdout

Known output plugins:

License

MIT