Skip to content

Commit

Permalink
Update master
Browse files Browse the repository at this point in the history
  • Loading branch information
mixu committed Jun 9, 2012
1 parent 11cd8f6 commit 37975ae
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ You can pipe to more than one pipe if you want.

Basic usage:

var log = require('minilog')();
var log = require('minilog')('app');

require('minilog').pipe(process.stdout);

Expand All @@ -49,21 +49,13 @@ Basic usage:
.warn('warning')
.error('this is an error message');

You can namespace logs:
Output depends on the formatter function. The node_console backend has several built-in inspired by [logme](https://github.com/vesln/logme):

var log = require('minilog')('worker');

require('minilog').pipe(process.stdout);

log.info('Booting', { foo: 'bar' });
log.error('FooBar');
log('Hello', 'World');
![screenshot](https://github.com/mixu/minilog/raw/master/test/example/screenshot.png)

Output:
Have a look at [./test/examples/themes_example.js](https://github.com/mixu/minilog/blob/master/test/example/themes_example.js) - basically, you pass the formatter to .pipe().format().

worker info Booting {"foo":"bar"}
worker error FooBar
worker Hello World
The withStack formatter can print the module name and current line number by examining the stack trace.

## Formatting / templating

Expand All @@ -77,11 +69,6 @@ Each pipe returns a chainable config object. Formatting can be applied to pipes:
+ args.join(' ') + '\n';
});

The console logger comes with format functions inspired by [logme](https://github.com/vesln/logme).
The withStack formatter can print the module name and current line number by examining the stack trace.

![screenshot](https://github.com/mixu/minilog/raw/master/test/example/screenshot.png)

## Adding filters

Filters can be applied to pipes:
Expand Down

0 comments on commit 37975ae

Please sign in to comment.