rvagg/bole

Question: disable logging?

leftieFriele opened this issue · 2 comments

I got a sneaking suspicion that this is a too simple question, but I'll add it anyway as I've found no way to do this. I'd like to disable the bole logger, how can I achieve that?

I use bole to log inside a library module, but I want the consumer of the library to be able to toggle logging inside my module. For some reason I can't get bole to not log once I've required the module.

haha, not sure if this would work, but perhaps write to /dev/null using a write stream?

const sink = fs.createWriteStream('/dev/null', { flags: 'a' })

And then set that as the write target for bole. Untested, just a guess :')

rvagg commented

require('bole').reset() should do the trick