MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / capture

Method capture

atomic-cli/src/output/live.rs:27–44  ·  view source on GitHub ↗
(&mut self, kind: Kind, message: &str)

Source from the content-addressed store, hash-verified

25
26impl State {
27 fn capture(&mut self, kind: Kind, message: &str) {
28 self.latest = console::strip_ansi_codes(message)
29 .chars()
30 .take(200)
31 .collect();
32 match kind {
33 Kind::Info => {}
34 Kind::Success => self.success = Some(message.chars().take(4096).collect()),
35 Kind::Warning | Kind::Error => {
36 if self.diagnostics.len() == MAX_DIAGNOSTICS {
37 self.diagnostics.pop_front();
38 self.omitted += 1;
39 }
40 self.diagnostics
41 .push_back((kind, message.chars().take(4096).collect()));
42 }
43 }
44 }
45}
46
47pub(crate) fn is_active() -> bool {

Calls 2

collectMethod · 0.45
lenMethod · 0.45