-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
Today the only available option is log to provide a custom logging function. It's a good escape hatch that's highly flexible, but I'm wondering if there should be other options in between. Not proposing to copy every option redux-logger supports, but maybe some are worth the effort.
Here are some proposed options:
-
filter- provide a filter function to decide which actions to log and which to ignore. The filter function is passed the{name, data}object describing each action. Defaults to show all actions by always returningtrue. -
format- function to pre-process the state values before being passed to the logger. This allows for returning a new object with the state reorganized to be more readable or in a preferred String format. Defaults to the identity function. -
diff- try to print an intelligent diff of what state the action updated. In the case of redux-logger deep-diff was used. Defaults tofalse. -
performance- show how long the action took from start to end. Defaults tofalse. -
timing- show the time the action began and/or ended. Defaults tofalse. -
sameStateWarning- include a warning when not returning a new state object from an action. Defaults tofalse. See Logs the same object as prev and next state #3.
frenzzy, Ovyerus and segundaestrella