v7.10.0
7.10.0 (2022-03-18)
Features
If you ever need to test what is getting logged, Roarr (v7.10) now has a neat trick:
const messages = [];
log.adopt(() => {
yourApplication();
}, (message) => {
messages.push(message);
});
messages
now includes anything that is/will going to be logged by yourApplication
(including any of the descending async contexts).
You could even do something like this:
log.adopt(() => {
httpServer.listen(8080);
}, (message) => {
messages.push(message);
})
Now messages
would get appended to every time that HTTP server handles a request which produces Roarr logs.
Example of where this is useful: