Skip to content

Add filter to the logger #710

Closed
Closed
@Yamakaky

Description

@Yamakaky

What problem does this feature solve?

In my application, I need to display the current time, so I added a field that I update each second with a new Date(). The trouble is that it floods the console with updates notifications. I would like to be able to log all the mutations except this one.

What does the proposed API look like?

const logger = createLogger({
    filter(type, state_before, state_after) {
        return type !== "update_time"
    },
})

I personally only care about type, but if state_before and state_after are not too complicated to compute it may be useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions