diff --git a/docs/guide/plugins.md b/docs/guide/plugins.md index bb13ed555..c89c1bfb3 100644 --- a/docs/guide/plugins.md +++ b/docs/guide/plugins.md @@ -128,7 +128,7 @@ const logger = createLogger({ // Same as mutationTransformer but for actions return action.type }, - logActions: false, // Log Actions + logActions: true, // Log Actions logMutations: true, // Log mutations logger: console, // implementation of the `console` API, default `console` }) diff --git a/src/plugins/logger.js b/src/plugins/logger.js index 496dc43b7..ccf2b6537 100644 --- a/src/plugins/logger.js +++ b/src/plugins/logger.js @@ -9,7 +9,7 @@ export default function createLogger ({ mutationTransformer = mut => mut, actionFilter = (action, state) => true, actionTransformer = act => act, - logActions = false, + logActions = true, logMutations = true, logger = console } = {}) { @@ -42,9 +42,7 @@ export default function createLogger ({ if (logActions) { store.subscribeAction((action, state) => { - const currentState = deepCopy(state) - - if (actionFilter(action, currentState)) { + if (actionFilter(action, state)) { const formattedTime = getFormattedTime() const formattedAction = actionTransformer(action) const message = `action ${action.type}${formattedTime}`