chromedevtools--chrome-devtools-mcp
61f37d6615
This PR implements the core logging infrastructure for the telemetry system. It introduces the `ClearcutLogger` class, integrates it into the server lifecycle events, and establishes the `ClearcutSender` abstraction. **Implementation Roadmap:** This is the second in a series of PRs designed to implement a robust, privacy-conscious telemetry system: 1. **CLI & Opt-out Mechanism ([Merged](https://github.com/ChromeDevTools/chrome-devtools-mcp/pull/757)):** * Added `--usage-statistics` flag and transparency logging. 2. **Logger Scaffolding & Integration (This PR):** * **`ClearcutLogger`**: Implemented the main logging entry point. * **One-way Data Flow**: Integrated `logToolInvocation` and `logServerStart` hooks into `main.ts` to capture events. * **`ClearcutSender`**: Introduced a transport abstraction (currently a dummy implementation) that will later handle HTTP requests, batching, and retries. * **Type Definitions**: Added TypeScript definitions for the telemetry Protocol Buffer messages. 3. **Persistence Layer (Next):** * Implement local state management to reliably track "First Time Installation" and "Daily Active" metrics. 4. **Watchdog Process Architecture (Next):** * Move `ClearcutSender` execution to a dedicated watchdog process to ensure reliable event transmission even during abrupt server shutdowns. 5. **Transport, Batching & Retries (Next):** * Finalize `ClearcutSender` with actual HTTP transport logic, including event batching and exponential backoff retries.