'use strict';

var _immutable = require('immutable');

var _immutable2 = _interopRequireDefault(_immutable);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const createLogger = require('redux-logger');

module.exports = function clogger() {
  const logger = createLogger({
    predicate: (getState, action) => action.type.includes('COMM'),
    stateTransformer: state => Object.keys(state).reduce((prev, key) => Object.assign({}, prev, { [key]: _immutable2.default.Iterable.isIterable(state[key]) ? state[key].toJS() : state[key] }), {})
  });
  return logger;
};