{"_id":"@concord-consortium/log-monitor","_rev":"3-b549c8992b719bd20e309c84b7d9fd9e","name":"@concord-consortium/log-monitor","dist-tags":{"pre":"1.0.0-pre.0","latest":"1.0.0"},"versions":{"1.0.0-pre.0":{"name":"@concord-consortium/log-monitor","version":"1.0.0-pre.0","license":"MIT","_id":"@concord-consortium/log-monitor@1.0.0-pre.0","maintainers":[{"name":"concordconsortium","email":"softwaredev@concord.org"},{"name":"scytacki","email":"scytacki@concord.org"},{"name":"dougmartin","email":"doug@zoopdoop.com"},{"name":"tealefristoe","email":"fristoe@gmail.com"},{"name":"kswenson","email":"kswenson@concord.org"},{"name":"emcelroy","email":"emcelroy@concord.org"}],"homepage":"https://github.com/concord-consortium/log-monitor#readme","bugs":{"url":"https://github.com/concord-consortium/log-monitor/issues"},"dist":{"shasum":"6a6213ac5e4f306365f45ad2da801766e7560f2e","tarball":"https://registry.npmjs.org/@concord-consortium/log-monitor/-/log-monitor-1.0.0-pre.0.tgz","fileCount":19,"integrity":"sha512-Ieh8Tj2BzrYdcCYbPQMIbF7kNMRGqMXzmjXluNNm/YFgXGCMTkC7dqVdisRcUWD6SFuGIJfBBYbnUR3ZGWN/eQ==","signatures":[{"sig":"MEQCIBv2WzmuhlNvTmeoWZL8Ul+bpjiayPSYjlWYWo1m9vN6AiAtDABkq+vtuH23sJ5hijvNw730y3Mmj23au3yDvQFzbg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34482},"jest":{"transform":{"^.+\\.tsx?$":"ts-jest"},"testEnvironment":"jsdom","moduleNameMapper":{"\\.(css|less|sass|scss)$":"identity-obj-proxy"}},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"a0ba993126b28f2bc5fe615a026f48cb7732cb5b","scripts":{"test":"jest","build":"tsc","build:watch":"tsc --watch","yalc:publish":"npm run build && yalc publish"},"_npmUser":{"name":"dougmartin","email":"doug@zoopdoop.com"},"repository":{"url":"git+https://github.com/concord-consortium/log-monitor.git","type":"git"},"_npmVersion":"10.9.2","description":"Real-time log event monitor sidebar with filtering and CSV/JSON export","directories":{},"_nodeVersion":"22.17.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","react":"^18.2.0","ts-jest":"^29.1.0","react-dom":"^18.3.1","typescript":"^5.1.0","@types/jest":"^29.5.0","@types/react":"^18.2.0","identity-obj-proxy":"^3.0.0","@testing-library/react":"^14.3.1","jest-environment-jsdom":"^29.7.0","@testing-library/jest-dom":"^6.9.1"},"peerDependencies":{"react":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/log-monitor_1.0.0-pre.0_1774293608585_0.6341043453663842","host":"s3://npm-registry-packages-npm-production"}},"1.0.0-pre.1":{"name":"@concord-consortium/log-monitor","version":"1.0.0-pre.1","license":"MIT","_id":"@concord-consortium/log-monitor@1.0.0-pre.1","maintainers":[{"name":"concordconsortium","email":"softwaredev@concord.org"},{"name":"scytacki","email":"scytacki@concord.org"},{"name":"dougmartin","email":"doug@zoopdoop.com"},{"name":"tealefristoe","email":"fristoe@gmail.com"},{"name":"kswenson","email":"kswenson@concord.org"},{"name":"emcelroy","email":"emcelroy@concord.org"}],"homepage":"https://github.com/concord-consortium/log-monitor#readme","bugs":{"url":"https://github.com/concord-consortium/log-monitor/issues"},"dist":{"shasum":"8d845599b5d5e7e2fcb5df77819262a31d20ce85","tarball":"https://registry.npmjs.org/@concord-consortium/log-monitor/-/log-monitor-1.0.0-pre.1.tgz","fileCount":19,"integrity":"sha512-sBqVF1yzmX1lHcICPVuRyRvPDF/uyPqzEYLRYOfgKGkxACmwsGWeqqJFcY4zqGlzYw1SeyzcpvlW40Iu37m43g==","signatures":[{"sig":"MEQCIGwUJCTFTlvbZR4qdP2A6rXpBzrfJwrKopuy2wPSWedMAiBtUBoTZ1p7h6BIhTP4NgOIz9Of5EEx2Rxh5jtNgiqngQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36927},"jest":{"transform":{"^.+\\.tsx?$":"ts-jest"},"testEnvironment":"jsdom","moduleNameMapper":{"\\.(css|less|sass|scss)$":"identity-obj-proxy"}},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"0f572adb5bb73cd60cce3b8032cf27dd1ca46c47","scripts":{"demo":"vite","test":"jest","build":"tsc","build:watch":"tsc --watch","yalc:publish":"npm run build && yalc publish","prepublishOnly":"bash scripts/check-version.sh && npm run build"},"_npmUser":{"name":"dougmartin","email":"doug@zoopdoop.com"},"repository":{"url":"git+https://github.com/concord-consortium/log-monitor.git","type":"git"},"_npmVersion":"10.9.2","description":"Real-time log event monitor sidebar with filtering and CSV/JSON export","directories":{},"_nodeVersion":"22.17.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","vite":"^8.0.3","react":"^18.2.0","ts-jest":"^29.1.0","react-dom":"^18.3.1","typescript":"^5.1.0","@types/jest":"^29.5.0","@types/react":"^18.2.0","identity-obj-proxy":"^3.0.0","@vitejs/plugin-react":"^6.0.1","@testing-library/react":"^14.3.1","jest-environment-jsdom":"^29.7.0","@testing-library/jest-dom":"^6.9.1"},"peerDependencies":{"react":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/log-monitor_1.0.0-pre.1_1774529952783_0.9051175664962479","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@concord-consortium/log-monitor","version":"1.0.0","description":"Real-time log event monitor sidebar with filtering and CSV/JSON export","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","build:watch":"tsc --watch","test":"jest","yalc:publish":"npm run build && yalc publish","demo":"vite","prepublishOnly":"bash scripts/check-version.sh && npm run build"},"peerDependencies":{"react":">=16.8.0"},"devDependencies":{"@testing-library/jest-dom":"^6.9.1","@testing-library/react":"^14.3.1","@types/jest":"^29.5.0","@types/react":"^18.2.0","@vitejs/plugin-react":"^6.0.1","identity-obj-proxy":"^3.0.0","jest":"^29.7.0","jest-environment-jsdom":"^29.7.0","react":"^18.2.0","react-dom":"^18.3.1","ts-jest":"^29.1.0","typescript":"^5.1.0","vite":"^8.0.3"},"jest":{"transform":{"^.+\\.tsx?$":"ts-jest"},"testEnvironment":"jsdom","moduleNameMapper":{"\\.(css|less|sass|scss)$":"identity-obj-proxy"}},"repository":{"type":"git","url":"git+https://github.com/concord-consortium/log-monitor.git"},"bugs":{"url":"https://github.com/concord-consortium/log-monitor/issues"},"homepage":"https://github.com/concord-consortium/log-monitor#readme","license":"MIT","_id":"@concord-consortium/log-monitor@1.0.0","gitHead":"1a6aa5989c365133c81e87fe474f91e06c1c9ab8","_nodeVersion":"22.17.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-3eGS2jkil8MdEYMSaW/lJV2OYaW+kQsPoRUx086D+XaYdC3sRwIGq+Laqh7/qPCApnL+tj/ZA27bWZ5u4oSF9w==","shasum":"18cec21ab8feb60df5ec4bf5ab455f66039eda46","tarball":"https://registry.npmjs.org/@concord-consortium/log-monitor/-/log-monitor-1.0.0.tgz","fileCount":19,"unpackedSize":36907,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCFoLLJ8BhIifPe7lWdlQuYDA7d79KmnbExtIP37/WyuAIgZv8zhQVeh2rr48NvvTulSWZA+0h2eu001BLp/bmCqvk="}]},"_npmUser":{"name":"dougmartin","email":"doug@zoopdoop.com"},"directories":{},"maintainers":[{"name":"concordconsortium","email":"softwaredev@concord.org"},{"name":"scytacki","email":"scytacki@concord.org"},{"name":"dougmartin","email":"doug@zoopdoop.com"},{"name":"tealefristoe","email":"fristoe@gmail.com"},{"name":"kswenson","email":"kswenson@concord.org"},{"name":"emcelroy","email":"emcelroy@concord.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/log-monitor_1.0.0_1774825258165_0.7006192117965011"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-23T19:20:08.468Z","modified":"2026-03-29T23:00:58.589Z","1.0.0-pre.0":"2026-03-23T19:20:08.718Z","1.0.0-pre.1":"2026-03-26T12:59:12.938Z","1.0.0":"2026-03-29T23:00:58.326Z"},"bugs":{"url":"https://github.com/concord-consortium/log-monitor/issues"},"license":"MIT","homepage":"https://github.com/concord-consortium/log-monitor#readme","repository":{"type":"git","url":"git+https://github.com/concord-consortium/log-monitor.git"},"description":"Real-time log event monitor sidebar with filtering and CSV/JSON export","maintainers":[{"name":"concordconsortium","email":"softwaredev@concord.org"},{"name":"scytacki","email":"scytacki@concord.org"},{"name":"dougmartin","email":"doug@zoopdoop.com"},{"name":"tealefristoe","email":"fristoe@gmail.com"},{"name":"kswenson","email":"kswenson@concord.org"},{"name":"emcelroy","email":"emcelroy@concord.org"}],"readme":"# @concord-consortium/log-monitor\n\nA real-time log event monitor sidebar for Concord Consortium applications. Displays log events as they fire, with filtering, expandable payloads, and CSV/JSON export. Supports light and dark themes.\n\n## Installation\n\n```bash\nnpm install @concord-consortium/log-monitor\n```\n\nDuring development, use [yalc](https://github.com/wclr/yalc) for local linking:\n\n```bash\n# In the log-monitor repo:\nyalc publish\n\n# In the consuming app:\nyalc add @concord-consortium/log-monitor\n```\n\n## Usage\n\nThere are two ways to connect the LogMonitor to your app's logging:\n\n### Direct log wrapper\n\nFor apps that call `log()` directly (e.g., simulation models using `@concord-consortium/lara-interactive-api`):\n\n```ts\nimport { log as originalLog } from \"@concord-consortium/lara-interactive-api\";\nimport { createLogWrapper } from \"@concord-consortium/log-monitor\";\n\nconst log = enabled ? createLogWrapper(originalLog) : originalLog;\n```\n\n### Listener/subscriber\n\nFor apps with a centralized Logger that has a listener API or event emitter:\n\n```ts\nimport { emitLogEvent } from \"@concord-consortium/log-monitor\";\n\nLogger.registerLogListener((logMessage) => {\n  const { event, ...data } = logMessage;\n  emitLogEvent({ event, data, timestamp: Date.now() });\n});\n```\n\n### Rendering the sidebar\n\n```tsx\nimport { LogMonitor } from \"@concord-consortium/log-monitor\";\n\n{enabled && <LogMonitor logFilePrefix=\"my-app-log-events\" theme=\"dark\" />}\n```\n\n## Props\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| `logFilePrefix` | `string` | `\"log-events\"` | Prefix for exported CSV/JSON filenames |\n| `theme` | `\"light\" \\| \"dark\"` | `\"light\"` | Color theme for the sidebar |\n\n## Exports\n\n| Export | Type | Description |\n|--------|------|-------------|\n| `LogMonitor` | React component | The sidebar UI |\n| `createLogWrapper` | `(originalLog) => wrappedLog` | Wraps a log function to also emit to the monitor |\n| `emitLogEvent` | `(entry: LogEntry) => void` | Manually push an event into the monitor |\n| `onLogEvent` | `(listener) => unsubscribe` | Subscribe to log events (used internally by `LogMonitor`) |\n| `LogEntry` | TypeScript type | `{ event: string; data?: Record<string, unknown>; timestamp: number }` |\n| `LogMonitorProps` | TypeScript type | Props for the `LogMonitor` component |\n\n## Integrations\n\nSee [integrations.md](integrations.md) for detailed integration guides with code examples for each Concord Consortium application:\n\n- **hurricane-model** / **wildfire-model** / **flooding-model** — direct log wrapper\n- **activity-player** — Logger/LARA Events subscriber (sees all embedded interactives)\n- **question-interactives demo** — postMessage subscriber (replaces `console.log`)\n- **collaborative-learning (CLUE)** — `Logger.registerLogListener()` (100+ event types)\n- **CODAP v3** — `Logger.registerLogListener()`\n\n## Development\n\n```bash\ngit clone https://github.com/concord-consortium/log-monitor.git\ncd log-monitor\nnpm install\nnpm test\nnpm run build\n```\n\n### Demo\n\nAn internal demo app is included for developing and testing the LogMonitor component in isolation:\n\n```bash\nnpm run demo\n```\n\nThis starts a Vite dev server with a control panel that lets you:\n\n- Select **payload size** (none, small, medium, large) to test the payload viewer at different data volumes\n- Send events with **short, medium, or long event names** to test name layout/truncation\n- Set the **number of events** to send in a batch and the **delay** between them\n- Toggle **light/dark theme**\n\nThe demo is excluded from the published npm package (`\"files\": [\"dist\"]`) and from the library's TypeScript build.\n\n### Testing in a consuming app\n\nTo test changes in a consuming app locally:\n\n```bash\nnpm run build && yalc push\n```\n\n## Deployment\n\nEvery push to `master` triggers a GitHub Actions workflow that builds and deploys the demo app to S3.\n\n**Live demo:** https://models-resources.concord.org/log-monitor/branch/master/\n\nNOTE: Publishing to npm is a separate step.  It is not automatically done as part of the deployment process.\n\n## Publishing\n\n1. Update the `version` constant in `src/index.ts` and `version` in `package.json`\n2. Run `npm install` to update `package-lock.json`\n3. Run `npm publish` to publish\n\nThe `prepublishOnly` script automatically runs the build before publishing.\n\n## Requirements\n\n- React >= 16.8 (peer dependency)\n- No other dependencies\n\n# License\n\nCopyright 2026 (c) by the Concord Consortium and is distributed under the [MIT license](http://www.opensource.org/licenses/MIT).","readmeFilename":"README.md"}