Hi everyone,
Been using bunyan a couple months now and really liking a lot of things about it!
I'm running into a fairly common pattern in my code where I'd like to be able to configure some run-time debugging but the generation of the actual log data is pretty expensive.
So what I'd love to do is be able to pass a function as the 1st argument that would generate the arguments. Like so:
logger.debug( () => [ { a: 1, b: this.somethingExpensive()}, 'my message', {extra: 'stuff'} ] )
This would only execute the function if debug was an allowable log level.
Is something like this possible ? Would it be useful for anyone else?
Thanks
Jordan