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

Method snapshot

packages/server/src/logs.rs:128–147  ·  view source on GitHub ↗
(&self, udid: &str, filters: &LogFilters, limit: usize)

Source from the content-addressed store, hash-verified

126 }
127
128 pub async fn snapshot(&self, udid: &str, filters: &LogFilters, limit: usize) -> Vec<LogEntry> {
129 let state = {
130 let streams = self.streams.lock().await;
131 streams.get(udid).cloned()
132 };
133 let Some(state) = state else {
134 return Vec::new();
135 };
136
137 let entries = state.entries.lock().await;
138 let mut matching: Vec<LogEntry> = entries
139 .iter()
140 .filter(|entry| log_entry_matches(entry, filters))
141 .cloned()
142 .collect();
143 if matching.len() > limit {
144 matching = matching.split_off(matching.len() - limit);
145 }
146 matching
147 }
148}
149
150fn spawn_log_stream_process(udid: &str) -> Result<Child, AppError> {

Calls 2

log_entry_matchesFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected