Skip to content

Commit f1eea1d

Browse files
author
Eugene Rodionov
committed
feat: #121
1 parent 3c1efd9 commit f1eea1d

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,22 @@ Logger **must be** last middleware in chain, otherwise it will log thunk and pro
2727
createLogger(options?: Object) => LoggerMiddleware
2828
```
2929

30+
### Options
31+
```js
32+
{
33+
level = 'log': 'log' | 'console' | 'warn' | 'error' | 'info', // console's level
34+
duration = false: Boolean, // Print the duration of each action?
35+
timestamp = true: Boolean, // Print the timestamp with each action?
36+
colors: ColorsObject, // Object with color getters. See the ColorsObject interface.
37+
logger = window.console: LoggerObject, // Implementation of the `console` API.
38+
logErrors = true: Boolean, // Should the logger catch, log, and re-throw errors?
39+
collapsed, // Takes a boolean or optionally a function that receives `getState` function for accessing current store state and `action` object as parameters. Returns `true` if the log group should be collapsed, `false` otherwise.
40+
predicate, // If specified this function will be called before each action is processed with this middleware.
41+
stateTransformer, // Transform state before print. Eg. convert Immutable object to plain JSON.
42+
actionTransformer, // Transform state before print. Eg. convert Immutable object to plain JSON.
43+
errorTransformer // Transform state before print. Eg. convert Immutable object to plain JSON.
44+
}
45+
```
3046

3147
### Options
3248

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "redux-logger",
3-
"version": "2.4.0",
3+
"version": "2.5.0",
44
"description": "Logger for redux",
55
"main": "lib/index.js",
66
"scripts": {

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const timer = typeof performance !== `undefined` && typeof performance.now === `
2626
function createLogger(options = {}) {
2727
const {
2828
level = `log`,
29-
logger = window.console,
29+
logger = console,
3030
logErrors = true,
3131
collapsed,
3232
predicate,

0 commit comments

Comments
 (0)