Skip to content

Add filter to the logger #710

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

Closed
Yamakaky opened this issue Mar 25, 2017 · 0 comments
Closed

Add filter to the logger #710

Yamakaky opened this issue Mar 25, 2017 · 0 comments

Comments

@Yamakaky
Copy link
Contributor

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.

Yamakaky added a commit to Yamakaky/vuex that referenced this issue Mar 25, 2017
Yamakaky added a commit to Yamakaky/vuex that referenced this issue Mar 25, 2017
Yamakaky added a commit to Yamakaky/vuex that referenced this issue Mar 25, 2017
@ktsn ktsn added the proposal label Mar 27, 2017
yyx990803 pushed a commit that referenced this issue Apr 17, 2017
* Add filtering of the mutations logging

Fixes #710

* Taste and colours
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

2 participants