Releases: LogRocket/redux-logger
Releases · LogRocket/redux-logger
2.7.4 — revert 2.7.1 because redux-logger was broken in node.js
Changelog
- fix: revert changes from #185 because redux-logger was broken in node.js
Sorry for this, I was not careful and didn't tested that PR
2.7.2 — fix default title transformer
Changelog
- default title transformer has redundant symbols when
timestamp
is disabled (#186)
2.7.1 — fix undefined console in IE9
Changelog
- fix
undefined
console in IE9 (#185)
2.7.0 — diff (alpha), formatter for title
Diff
@sibelius merged redux-diff-logger
and now you can use it by passing diff: true
to options
in createLogger()
, f.e.
const logger = createLogger({
diff: true,
});
❗️ Diff is very unstable and not tested, so we don't recommend use it as primary feature of logging.
Formatter for title
@spalger made titleFormatter
option (#165)
titleFormatter = (action: Object, time: String?, took: Number?) => title
Format the title used for each action.
Default: prints something like action @ ${time} ${action.type} (in ${took.toFixed(2)} ms)
Bugfixes
- fix:
performance
now checking fornull
and don't fail withTypeError
(#173) - fix: default color of title now inherits console's default color (#176)
2.6.1
2.6.0
Fine-grained control over level
🚀
Thankfully to @mathieudutour now we have very useful feature: fine-grained control over level
.
function
const logger = createLogger({
level: (action) => action.type === `SET_AUTH_TOKEN` ? `warning` : `log`
});
object
const logger = createLogger({
level: {
prevState: `log`,
action: `info`,
nextState: `log`,
error: `error`,
},
});
object with functions
const logger = createLogger({
level: {
prevState: false, // disable message of prevState
action: ({ type }) => type.indexOf(`redux-form`) > -1 ? false : `info`, // don't show messages from redux-form (sorry, erikras, it's for demo only!)
nextState: ({ type }) => type.indexOf(`user`) > -1 ? `warning` : `info`, // show nextState as warning if action is user-related
error: `error`,
},
});