From cb6e84921e76d745337bd0885ec3a5eb74889515 Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Mon, 18 Jun 2012 12:08:48 -0700 Subject: [PATCH] add warning about `log.info(myobj)` as both Yunong and Orlando have hit this (at least) --- README.md | 8 ++++++++ TODO.md | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c818477..b8083b7 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,14 @@ The full `log.{trace|debug|...|fatal}(...)` API is: log.info(err, 'more on this: %s', more); // ... or you can specify the "msg". +Note that this implies **you cannot pass any object as the first argument +to log it**. IOW, `log.info(myobject)` isn't going to work the way you +expect. Adding support for this API would necessitate (a) JSON-ifying safely +that given object (sometimes hard, and probably slow) and (b) putting all its +attribs under a top-level 'x' field name or something to avoid field name +collisions. + + ## bunyan tool A `bunyan` tool is provided **for pretty-printing bunyan logs** and, eventually, diff --git a/TODO.md b/TODO.md index 1eadffb..58d598f 100644 --- a/TODO.md +++ b/TODO.md @@ -1,4 +1,4 @@ -- [Yuonong] buffered writes to increase speed: +- [Yunong] buffered writes to increase speed: - I'd start with a tools/timeoutput.js for some numbers to compare before/after. Sustained high output to a file. - perhaps this would be a "buffered: true" option on the stream object @@ -20,9 +20,14 @@ as the basis for tools to consume bunyan logs. It can grow indep of node-bunyan for generating the logs. It would take a Bunyan log record object and be expected to emit it. + + node-bunyan-reader + .createReadStream(path, [options]) ? + - document "well-known" keys from bunyan CLI p.o.v.. Add "client_req". - bunyan tool: built in less usage (a la git?) so that I don't have to go through this: `bunyan --color master.log | less -R` +- want `bunyan -f foo.log` a la `tail -f`