-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #1: Adding an option to print the level in String instead of Integer
This commit fixes Issue #1 by adding an option to display the level using its String representation. Suggesting it to be the 0.2.0 version. * modified: lib/format-record.js - Adding a method to map the level suggested by @olsonpm at trentm/node-bunyan#194 (comment) - If the option is used, just change the level. * modified: README.md - Updating the documentation by adding the examples of outputing the reports using the levels in String. * new file: example/bunyan-string-level.js - Adding the new example that logs the level using the string representation. * modified: package.json - Bumping the version to 0.2.0
- Loading branch information
1 parent
e3d016b
commit ba068ad
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict'; | ||
|
||
var bunyan = require('bunyan') | ||
, bformat = require('../') | ||
, formatOut = bformat({ outputMode: 'bunyan', levelInString: true }) | ||
; | ||
|
||
var log = bunyan.createLogger({ name: 'app', stream: formatOut, level: 'debug' } ); | ||
|
||
log.info('starting up'); | ||
log.debug('things are heating up', { temperature: 80, status: { started: 'yes', overheated: 'no' } }); | ||
log.warn('getting a bit hot', { temperature: 120 }); | ||
log.error('OOOOHHH it burns!', new Error('temperature: 200')); | ||
log.fatal('I died! Do you know what that means???'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters