Short answer: Yes
See how they got it implemented in their test case.
var bunyan = require('../lib/bunyan');
var log1 = bunyan.createLogger({
name: 'log1',
streams: [
{
path: __dirname + '/level.test.log1.log',
level: 'info' /* Using word */
}
]
});
Reference:
https://github.com/trentm/node-bunyan/blob/master/test/level.test.js
I had a quick look at their source code and it seems like you could also possibly get away with something like bunyan.levelFromName.fatal
or bunyan.levelFromName["fatal"]
to get the respective debugging value too.
See:
https://github.com/trentm/node-bunyan/blob/master/lib/bunyan.js#L253-L269
Also note:
The last few lines of the code.
module.exports.levelFromName = levelFromName;