Skip to content
pubscout

redux_logging

0.5.1, released 3 years ago by an unverified publisher

Redux.dart middleware that logs or prints the latest action, state, and timestamp.

WASM-ready
$ flutter pub add redux_logging
Source repository

What it does

Connects a Logger to a Redux store to record dispatched actions and current states. It provides a simple printer factory to output logs directly to the console or allows routing through standard Logger instances with customizable formatters.

AI-written summary of version 0.5.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are using Redux.dart and need to log dispatched actions and state changes
  • You want quick console printing for debugging Redux flows

Skip it when

  • You are using a state management solution other than Redux.dart like Riverpod or Bloc
  • You do not need action and state logging

Strengths

  • Easy setup with LoggingMiddleware.printer() for instant console logging
  • Supports custom message formatters for tailored log output
  • Integrates seamlessly with the standard Dart logging package

Weaknesses

  • Must be placed as the last middleware in the Redux store middleware list
  • Strictly tied to the redux package ecosystem

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2

Simply add the middleware to your Redux store definition.

import "package:redux/redux.dart";
import 'package:redux_logging/redux_logging.dart';

final store = new Store<int>(
  (int state, dynamic action) => state + 1,
  initialValue: 0,
  middleware: [new LoggingMiddleware.printer()]
);

Works with

Packages commonly used together with redux_logging: ones it builds on, ones built on it, and its own family.