flatiron/winston — pull request #242 by pdillon (2013-04-25 20:29:53+00:00)
Title: Support exclusive custom logging levels using negative numbers.

Would like to set up exclusive custom levels so messages are only written to matching transports. Any other transport with a level < log level are ignored.

//set my custom log levels
logger.setLevels({error_only:-3,warn_only:-2,info_only:-1});

//log only to custom warnings transport, not any other levels <
logger.log('warn_only','Only write this message to transport configured with level:warn_only');

Basically if a custom level is set with a negative number, the transport level needs to equal the logging level, instead of <= logging level. Can be mixed with levels >= 0.