Skip to content

Commit

Permalink
docs: update the new logger plugin export path (#1784)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiaking authored Jun 29, 2020
1 parent 04e2bd8 commit dbcbb11
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/guide/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,17 @@ The plugin will be used by default. For production, you will need [DefinePlugin]
Vuex comes with a logger plugin for common debugging usage:

``` js
import createLogger from 'vuex/dist/logger'
import { createLogger } from 'vuex'

const store = new Vuex.Store({
plugins: [createLogger()]
})
```

:::warning WARNING
Before v3.5.0, the `createLogger` function is exported at `vuex/dist/logger` package. PLease checkout the "Before Vuex v3.5.0" setion of this page.
:::

The `createLogger` function takes a few options:

``` js
Expand Down Expand Up @@ -137,3 +141,15 @@ const logger = createLogger({
The logger file can also be included directly via a `<script>` tag, and will expose the `createVuexLogger` function globally.

Note the logger plugin takes state snapshots, so use it only during development.

#### Before Vuex v3.5.0

Before v3.5.0, the `createLogger` function is exported at `vuex/dist/logger` package.

``` js
import createLogger from 'vuex/dist/logger'

const store = new Vuex.Store({
plugins: [createLogger()]
})
```

0 comments on commit dbcbb11

Please sign in to comment.