Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roarr filter .roarr.js #7

Open
dmpvost opened this issue Apr 22, 2020 · 0 comments
Open

roarr filter .roarr.js #7

dmpvost opened this issue Apr 22, 2020 · 0 comments

Comments

@dmpvost
Copy link

dmpvost commented Apr 22, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant