npm i --save freactal-logger
In freactal mddleware is defined per state container, so you should create logger for per state container.
import { provideState } from 'freactal';
import createLogger from 'freactal-logger';
const logger = createLogger({
// ...options
});
provideState({
middleware: [logger],
});
{
collapsed, // the log group is collapsed or not.
}
Takes a boolean to inidicate the log group should be collapsed or not.
Default: false
import { provideState } from 'freactal';
import createLogger from 'freactal-logger';
const middlewares = [];
if (process.env.NODE_ENV === `development`) {
const logger = createLogger();
middlewares.push(logger);
}
provideState({
middleware: middlewares,
});
- Write tests
- Support more options
Feel free to create PR for any of those tasks!
MIT