Last active
August 29, 2015 14:08
-
-
Save howarddierking/7f0dac11809e571651c3 to your computer and use it in GitHub Desktop.
testing bunyan
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
var bunyan = require('bunyan').createLogger({ | |
name: "foo", | |
streams: [ | |
{ | |
stream: process.stdout, | |
level: "trace" | |
} | |
] | |
}); | |
var logger = bunyan; | |
logger.info('this is an informational message'); | |
logger.warn('this is a warning message'); | |
logger.error(new Error('some error message'), 'this is an error message'); | |
// node app.js | |
// -> {"name":"foo","hostname":"13MBP-10303.local","pid":10851,"level":30,"msg":"this is an informational message","time":"2014-10-22T22:37:48.997Z","v":0} |
Is this issue resolved? I am really curious to know what @howard asked since I am facing the same issue. Even though I throw an error but my code only displays INFO level or DEBUG info as per level set by me.
Does bunyan not follow priority levels here?
By default they are like
TRACE = 10
DEBUG = 20
INFO = 30
WARN = 40
ERROR = 50
FATAL = 60
So if i set level to 30 , I should get all logs for INFO, WARN , ERROR and FATAL
and if I set it to 20, I should get logs for DEBUG, INFO, WARN , ERROR and FATAL?
Just trying to understand the basic functioning of bunyan in node here.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@howarddierking I can't repro:
What version of bunyan are you using?