Permalink
Browse files

fixed some words

  • Loading branch information...
1 parent 074e84b commit 00768a5c1a8f4a820bddc938f2bbcef70e8f11ee @baryon committed Mar 5, 2012
Showing with 35 additions and 0 deletions.
  1. +35 −0 README.md
View
@@ -200,6 +200,22 @@ logger.log5('hello %s %d', 'world', 123);
```
+the filter support key-value pair, example: [color_console.js](https://github.com/baryon/tracer/blob/master/lib/color_console.js)
+
+```javascript
+{
+ filters : {
+ //log : colors.black,
+ trace : colors.magenta,
+ debug : colors.blue,
+ info : colors.green,
+ warn : colors.yellow,
+ error : [ colors.red, colors.bold ]
+ }
+}
+```
+
+
### Log File Transport
```javascript
var fs = require('fs');
@@ -280,6 +296,25 @@ console.log('\n\n\npress ctrl-c to exit');
```
+### Define your logging helper
+
+the works is like [color_console.js](https://github.com/baryon/tracer/blob/master/lib/color_console.js)
+
+```javascript
+var colors = require('colors');
+module.exports = function(conf) {
+ return require('./console')({
+ filters : {
+ //log : colors.black,
+ trace : colors.magenta,
+ debug : colors.blue,
+ info : colors.green,
+ warn : colors.yellow,
+ error : [ colors.red, colors.bold ]
+ }
+ }, conf);
+};
+```
## History

0 comments on commit 00768a5

Please sign in to comment.