It would be useful to be enable control-override of the createLogger level option.
This setting ought to be controlled using environment variables, e.g. BUNYAN_LOG_LEVEL. This way it would be possible to enable different log levels without tracing down every instance of createLogger or leaving it up to the developer to respect the suggested BUNYAN_LOG_LEVEL setting.
See #176 for a similar issue. IMO control of logging output streams and levels belongs in the application using Bunyan, and not in the library itself. In #176 I created an example file that shows how the app using Bunyan can control this with environment variables itself: https://github.com/trentm/node-bunyan/blob/master/examples/mute-by-envvars-stream.js
Similar could be done for the log level. Something like:
var level = process.env.BUNYAN_LOG_LEVEL || 'info';
var log = bunyan.createLogger({name: 'foo', level: level});
The problem with:
var level = process.env.BUNYAN_LOG_LEVEL || 'info';
var log = bunyan.createLogger({name: 'foo', level: level});
is that you then leave it up to the developers to enforce a consistent standard. Which is fine. On the other hand, modules such as debug focus on standardising conventions, which ... at the level of debugging libraries, has been tremendously useful.
Most helpful comment
The problem with:
is that you then leave it up to the developers to enforce a consistent standard. Which is fine. On the other hand, modules such as
debugfocus on standardising conventions, which ... at the level of debugging libraries, has been tremendously useful.