Add log level option to subscribe method
Closed this issue · 1 comments
jsvd commented
The idea behind this is to allow
logger = Cabin::Channel.get
logger.level = :info
logger.subscribe(File.open("/tmp/log", "a"), :info) # :debug would be the same as nil
logger.subscribe(STDOUT, :warn)
Such that:
logger.debug("test")
won't be sent anywherelogger.info("test")
is sent only to the logfilelogger.fatal("test")
is sent to both
jordansissel commented
hmm, I'm open to this idea. For backwards compat, we can have subscribe(IO) with no level default to :debug