Dexie Logger is a middleware for Dexie.js, a wrapper for IndexedDB, designed to provide enhanced debugging capabilities by logging database operations. Currently at version 1.2.6, it offers detailed insights into database interactions such as `mutate`, `get`, `query`, and `openCursor`. While a specific release cadence isn't published, the project includes future development ideas, indicating an active maintenance state. Its key differentiator lies in its deep integration with Dexie, allowing developers to filter logs based on specific tables and operation types using either a whitelist or a blacklist approach. This makes it a valuable tool for isolating and debugging complex data flow issues within Dexie-backed applications, improving development efficiency and understanding of IndexedDB transactions.
npm install dexie-loggerVerified import paths — ran on the pinned version, not inferred.
Initializes a Dexie database, applies the logger middleware with specific table and operation filters, and performs database operations to demonstrate logging output in the console.
Choose `tableWhiteList` or `tablesBlackList` (not both), and `operationsWhiteList` or `operationsBlackList` (not both) to define your logging scope.
For production builds or performance-sensitive environments, consider disabling the logger or only enabling it conditionally during development or specific debugging sessions.
Ensure you have correctly initialized your Dexie database, e.g., `const db = new Dexie("MyDatabase");` and that you are calling `db.use()` on this instance.Review the logger configuration passed to `db.use(logger({ ... }))`. Temporarily remove all filters or broaden them to confirm the logger is working, then progressively re-apply filters to identify the specific rule preventing logs.Ensure your project supports ES Modules (ESM) or use a transpiler like Babel or TypeScript to convert ESM imports. If strictly in CommonJS and no transpilation, consider if the library offers a CommonJS export (though `dexie-logger` is primarily ESM-first).