Logger
Console logger for state changes.
Logger
The logger middleware tracks every state update and prints it to the browser console. It shows the previous state, the resulting next state, and an action name in the log title when one is available.
import { logger } from '@ilokesto/state/middleware';
const store = logger({ collapsed: true })({ count: 0 });Options
collapsed: (default:false) Collapses the log group by default.diff: (default:false) Displays a deep diff of state changes.timestamp: (default:true) Includes a timestamp in the log header.
Production Behavior
In production mode, logger is automatically disabled to avoid performance overhead and leaking sensitive information in the console. It simply returns the original store without any logging logic.