Hi Matt,
I was looking for something similar, but I think Environment variables are less intrusive than new levels. I'm coming from the Java world, where you can enable/disable logs per Logger object... For instance:
ComponentA
- Uses Bunyan logger
ComponentB
- Uses Bunyan Logger
- "include(ComponentA)"
My requirement is a way to turn ComponentA on/off during the execution of ComponentB based on any key of the log event object, say, "component": "componentA"... We could be looking for something like:
process.env.BUNYAN_LOG_DISABLE_componentA=true
Before logging, Bunyan would be looking at the set of keys "process.env.BUNYAN_LOG_DISABLE_*", and verify if the log event can be logged or not...
If your pull request gets merged, I will submit one that takes environment variables that verifies whether the log event contains the given key prior to logging...
thanks!