Releases: LogRocket/redux-logger
Releases · LogRocket/redux-logger
2.3.1
Changelog
Updates for error feature.
- feature: error color,
- feature:
logErrors
option (true or false), - feature:
errorTransfomer
2.3.0
2.2.1
Changelog
- feature:
colors.title
withaction
argument for better color management
Thankfully to @af and #100 now you can paint even title! 💅
For example, you can paint title for red
if action has fail
in type.
const logger = createLogger({
colors: {
title: (action) => {
if (action.type.indexOf(`fail`)) {
return `red`;
} else {
return `#111`;
}
};
}
})
2.1.4
2.1.3
2.1.2
2.1.1
Changelog
- deprecated:
transformer
is deprecated, usestateTransformer
instead - feature:
colors
object
Colors
We have so much requests (#91, #94 and other) about control over messages, so we bring it to life 🎉
Logger now have colors: Object
option with 3 keys: prevState
, action
, nextState
, each must return color as string (for example, red
or #03A9F4
).
prevState(prevState: Object) => color: String
action(action: Object) => color: String
nextState(nextState: Object) => color: String
colors
also can be false
if you don't need paint message or your env doesn't support console formatting (#92).
Examples
Disable colors
const logger = createLogger({
colors: false
});
Paint action message with type AUTH_TOKEN_REMOVE
to red
const logger = createLogger({
colors: {
prevState: () => `#9E9E9E`,
action: (action) => action.type === `AUTH_REMOVE_TOKEN` && `red`,
nextState: () => `#4CAF50`,
}
});