| 25 | |
| 26 | impl 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 | |
| 47 | pub(crate) fn is_active() -> bool { |