From 0d713a46d874b4264ca7a96ce1bf8eed03b1b898 Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Fri, 17 Feb 2012 11:22:14 -0800 Subject: [PATCH] improve intro to the 'log.info(...)' API --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 48e82b0..b4747d1 100644 --- a/README.md +++ b/README.md @@ -35,13 +35,17 @@ format version) are added for you. The full `log.{trace|debug|...|fatal}(...)` API is: log.info(); // Returns a boolean: is the "info" level enabled? - log.info(err); // Log an `Error` instance, adds "err" key with exception details - // (including the stack) and sets "msg" to the exception message. - // A special case, b/c logging errors should be easy. - log.info('hi'); // Log a simple string message. + + log.info('hi'); // Log a simple string message. log.info('hi %s', bob, anotherVar); // Uses `util.format` for msg formatting. + log.info({foo: 'bar'}, 'hi'); // Adds "foo" field to log record. + log.info(err); // Special case to log an `Error` instance, adds "err" + // key with exception details (including the stack) and + // sets "msg" to the exception message. + log.info(err, 'more on this: %s', more); + // ... or you can specify the "msg". ## bunyan tool