MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / recent_logs

Method recent_logs

packages/server/src/native/bridge.rs:568–592  ·  view source on GitHub ↗
(
        &self,
        udid: &str,
        seconds: f64,
        limit: usize,
        filters: &LogFilters,
    )

Source from the content-addressed store, hash-verified

566 }
567
568 pub fn recent_logs(
569 &self,
570 udid: &str,
571 seconds: f64,
572 limit: usize,
573 filters: &LogFilters,
574 ) -> Result<Vec<LogEntry>, AppError> {
575 let udid = CString::new(udid).map_err(|e| AppError::bad_request(e.to_string()))?;
576 let json = unsafe {
577 let mut error = ptr::null_mut();
578 let raw = ffi::xcw_native_recent_logs(udid.as_ptr(), seconds, limit, &mut error);
579 string_from_raw(raw, error)?
580 };
581 let payload: LogsEnvelope =
582 serde_json::from_str(&json).map_err(|e| AppError::internal(e.to_string()))?;
583 let mut entries: Vec<LogEntry> = payload
584 .entries
585 .into_iter()
586 .filter(|entry| log_entry_matches(entry, filters))
587 .collect();
588 if entries.len() > limit {
589 entries = entries.split_off(entries.len() - limit);
590 }
591 Ok(entries)
592 }
593
594 pub fn accessibility_snapshot(
595 &self,

Callers 1

simulator_logsFunction · 0.80

Calls 3

xcw_native_recent_logsFunction · 0.85
string_from_rawFunction · 0.85
log_entry_matchesFunction · 0.85

Tested by

no test coverage detected