Skip to content

Commit

Permalink
improve intro to the 'log.info(...)' API
Browse files Browse the repository at this point in the history
  • Loading branch information
trentm committed Feb 17, 2012
1 parent 8efd876 commit 0d713a4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0d713a4

Please sign in to comment.