MCPcopy Create free account
hub / github.com/aeroxy/chrome-devtools-cli / log_command

Method log_command

src/telemetry.rs:160–181  ·  view source on GitHub ↗

Log a command invocation. Non-blocking and best-effort — failures are silently ignored to avoid disrupting the user's workflow.

(
        &self,
        command: &str,
        duration: Duration,
        success: bool,
        error_code: Option<u32>,
    )

Source from the content-addressed store, hash-verified

158 /// Non-blocking and best-effort — failures are silently ignored
159 /// to avoid disrupting the user's workflow.
160 pub fn log_command(
161 &self,
162 command: &str,
163 duration: Duration,
164 success: bool,
165 error_code: Option<u32>,
166 ) {
167 let entry = json!({
168 "timestamp": SystemTime::now()
169 .duration_since(UNIX_EPOCH)
170 .map(|d| d.as_secs_f64())
171 .unwrap_or(0.0),
172 "command": command,
173 "duration_ms": duration.as_millis() as u64,
174 "success": success,
175 "error_code": error_code,
176 });
177 self.worker.send(LogEntry {
178 path: self.log_path(),
179 line: entry.to_string(),
180 });
181 }
182
183 /// Shut down the telemetry worker gracefully.
184 ///

Callers 1

log_commandFunction · 0.80

Calls 2

log_pathMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected