Skip to content

roarr filter .roarr.js #7

Description

@dmpvost

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions