roarr-cli
roarr-cli copied to clipboard
roarr filter .roarr.js
I'm trying to have 2 mode.
Collecte more data for full log, with my flag LOG_SHOW_AUGMENTED and when it's come to see the log in console, with roarr-cli I would like to be able to cut/delete some part of the object. to have a cleaner, more readable flow of log when it's comme to just see log
Is it possible to do that with .roarr.js? As I understood, it's only, true -> show, false don't show right now
It could be so nice if it's possible to modify data on the flight, just before show it
require('dotenv').config(); module.exports = { filterFunction: (obj) => { if (process.env.LOG_SHOW_AUGMENTED !== "true") { delete obj.context["augmented"]; delete obj.context.augmented; } if (obj && obj.context && obj.context.logLevel >= process.env.LOG_LEVEL) { return obj; } else { return false; } return obj; }, };