TODOne
This commit is contained in:
parent
44d280d688
commit
fb1ed4f4ee
2 changed files with 19 additions and 1 deletions
19
README.md
19
README.md
|
@ -69,6 +69,25 @@ streams at different levels**.
|
|||
]
|
||||
});
|
||||
|
||||
A `log.clone(...)` is provided to specialize a logger for a sub-component.
|
||||
The following will have log records from "Wuzzle" instances use exactly the
|
||||
same config as its parent, plus include the "component" field.
|
||||
|
||||
var log = new Logger(...);
|
||||
|
||||
...
|
||||
|
||||
function Wuzzle(options) {
|
||||
this.log = options.log;
|
||||
this.log.info("creating a wuzzle")
|
||||
}
|
||||
Wuzzle.prototype.woos = function () {
|
||||
this.log.warn("This wuzzle is woosey.")
|
||||
}
|
||||
|
||||
var wuzzle = new Wuzzle({log: log.clone({component: "wuzzle"})});
|
||||
wuzzle.woos();
|
||||
log.info("done with the wuzzle")
|
||||
|
||||
|
||||
# Future
|
||||
|
|
1
TODO.md
1
TODO.md
|
@ -1,4 +1,3 @@
|
|||
- add `clone` to readme
|
||||
- serializer support (i.e. repr of a restify request obj):
|
||||
server.js example
|
||||
restify-server.js example
|
||||
|
|
Loading…
Reference in a new issue