yarn redux-logger 2.6.0

latest releases: 4.0.0, 3.0.6, 3.0.5...
8 years ago

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`,
  },
});

Don't miss a new redux-logger release

NewReleases is sending notifications on new releases.