Skip to content

Update logger.js #588

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
wants to merge 1 commit into from
Closed

Update logger.js #588

wants to merge 1 commit into from

Conversation

marszhou
Copy link

add logger a new configurable param 'ignored', let programmer to decide to ignore some log he/she does not want to see.

add logger a new configurable param 'ignored', let programmer to decide to ignore some log he/she does not want to see.
@@ -5,6 +5,7 @@ import { deepCopy } from '../util'
export default function createLogger ({
collapsed = true,
transformer = state => state,
ignored = type => false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to pass mutation object instead of type?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think passing in the entire mutation object leaves room for more flexibility.

@@ -5,6 +5,7 @@ import { deepCopy } from '../util'
export default function createLogger ({
collapsed = true,
transformer = state => state,
ignored = type => false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think passing in the entire mutation object leaves room for more flexibility.

@ktsn
Copy link
Member

ktsn commented Apr 18, 2017

@marszhou I'm sorry that we already merged the same filtering feature for logger via #711. We totally forgot this PR.
You can add filter option that should have negated return value of your ignore option on createLogger since Vuex v2.3.1
Thank you for your PR, though.

@ktsn ktsn closed this Apr 18, 2017
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

Successfully merging this pull request may close these issues.

3 participants