gajus / gajus/roarr-cli

roarr filter .roarr.js

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
31
Forks
4
PR merge metrics
No merged PRs in 30d

Description

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;
},
};

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.