---
name: core/redux-action-logging
description: >-
  Opt-in Redux action logging for Store, ReactStore, and StreamingStore. Covers
  the construction-time logReduxActions option, grouped console records,
  presentation styles, immutable `reduxAction` stream events, unchanged-state
  output, and lazy path-keyed changes.
type: sub-skill
requires:
  - core
triggers:
  - redux action logging
  - logReduxActions
  - redux dispatch logging
  - action state diff
---
# Redux action logging

Use this skill when an agent needs to diagnose a dispatch by reading the Redux
action logger. This is a construction-time diagnostic for the shared Store
runtime; it is separate from selector tracing and from the browser devtools
inspection API.

## 1. Enable it for a focused reproduction

Pass `logReduxActions: true` in the **third Store constructor argument**. Pass
`undefined` as the middleware argument when no middleware is configured.

```ts
import { Store } from '@augmentcode/themis/svelte-store';
import { ReactStore } from '@augmentcode/themis/react-store';
import { StreamingStore } from '@augmentcode/themis/streaming-store';

const svelteStore = new Store(reducers, undefined, { logReduxActions: true });
const reactStore = new ReactStore(reducers, undefined, { logReduxActions: true });
const streamingStore = new StreamingStore(reducers, undefined, { logReduxActions: true });
```

Use the constructor corresponding to the app's Store family; do not combine
Svelte, React, and Streaming lifecycle patterns in one app. The option is
shared by all three families and is disabled when omitted or set to `false`.

The Store exposes six read-only Kefir streams through `traceStreams`:
`selectorDetail`, `selectorSummary`, `selectorCadence`, `sagaMonitor`,
`runtimeError`, and `reduxAction`. `reduxAction` is produced by pure middleware:
it calls `next(action)` before publishing one shallow-immutable event with the
action, previous/next state references, and `stateChanged`. Errors and return
values from `next` are preserved, and failed dispatches do not publish an event.

## 2. Read one action's group

With no `loggerFactory`, StoreRuntime's default logger prints a one-time `🔧 Redux Logger Active` legend, then renders each
dispatched action with `console.groupCollapsed`. Expand the action group before
interpreting it:

1. Read the action title to identify the dispatch. Primitive payloads, and a
   one-element array containing a primitive, may be included in the title;
   complex payloads are intentionally not rendered in the title.
2. Read the styled `action` record (`%c action`) to see the dispatched action,
   then the styled state record. The CSS/style argument attached to a console
   call controls presentation only; it is not part of the action or state data.
   The blue action label and green state label are visual legend entries, not
   extra fields.
3. A gray `state (no changes)` record contains `{ state: nextState }` and means
   the reducer returned the same state reference. It is a successful no-change
   dispatch, not missing logger output and not proof that the action was
   rejected. The group title is gray and lighter for this case; changed-state
   titles are bold.
4. For a changed state, expand the `state` record and then its `changes`
   property. It is a path-keyed diff: each key is
   a state path and its value contains the previous and next value for that
   path. The diff is lazy, so inspect or expand it in the console only when
   needed rather than assuming the logger eagerly captured a full state
   snapshot.

The title uses `color: inherit; font-weight: 600` for changed state and
`color: #9E9E9E; font-weight: 300` for unchanged state. Record labels use blue
for `action`, green for changed `state`, and gray/lighter styling for `state
(no changes)`; these styles are presentation hints only.

Treat paths and values in `changes` as diagnostic evidence for the current
Store instance. Redact sensitive values before sharing logs. Do not infer
changes from the group title alone.

## 3. Keep logging opt-in and temporary

There is no dev-mode switch, localStorage toggle, global debug-console toggle,
or runtime enable/disable API for this logger. The pure logger middleware and
the default StoreRuntime rendering are installed only when the normalized
constructor option is `true`; omitted and `false` options do not publish action
events or attach the default logger.

Pass a typed `loggerFactory` to replace default console rendering. It receives
the same six read-only streams and may return a disposer; it does not also
attach the built-in legend or Redux console groups. The factory is attached at
initialization, disposed with the Store, and reattached on a later successful
initialization.

Selector aggregation is independent of action logging: `summaryEnabled: true`
is the sole switch that allocates and periodically publishes selector summaries.
Detailed selector categories may be enabled without allocating a summary
collector, and action events never change that behavior.

To disable logging, omit the option or set `logReduxActions: false` **and
construct a new Store instance**. Changing an options object, calling `init()`
again, or disposing/reusing the existing instance does not reconfigure its
middleware pipeline.

After reproducing the issue, dispose the diagnostic Store through its normal
family lifecycle and remove the temporary `true` option from application code.

## 4. Common mistakes

- Do not look for a localStorage key or development-mode gate; neither controls
  this option.
- Do not treat CSS style strings as logger payloads.
- Do not call the unchanged-state record a logger failure.
- Do not request a complete before/after state dump when a path in `changes`
  answers the question; expand only the relevant lazy diff entries.
- Do not use `traceSelectors` to enable action logging. Selector tracing has a
  separate contract and option.

## See also

- `../debugging/SKILL.md` — Store inspection and lifecycle boundaries.
- `../selector-tracing/SKILL.md` — selector diagnostics, which are separate
  from Redux dispatch logging.