ALPHA: wire is a tool to deploy nixos systems wire.althaea.zone/
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

remove RawError variant

+7 -14
+2 -2
wire/lib/src/commands/interactive.rs
··· 431 431 432 432 if began { 433 433 if let Some(stripped) = line.strip_prefix('#') { 434 - output_mode.trace(stripped.to_string(), false); 434 + output_mode.trace(stripped.to_string()); 435 435 let mut queue = stdout_collection.lock().unwrap(); 436 436 queue.push_front(stripped.to_string()); 437 437 continue; 438 438 } 439 439 440 - let log = output_mode.trace(line.clone(), false); 440 + let log = output_mode.trace(line.clone()); 441 441 let mut queue = stderr_collection.lock().unwrap(); 442 442 443 443 if let Some(NixLog::Internal(log)) = log {
+2 -7
wire/lib/src/commands/mod.rs
··· 144 144 } 145 145 146 146 impl ChildOutputMode { 147 - fn trace(self, line: String, hint_error: bool) -> Option<NixLog> { 147 + fn trace(self, line: String) -> Option<NixLog> { 148 148 let log = match self { 149 149 ChildOutputMode::Nix => { 150 150 let log = 151 151 serde_json::from_str::<Internal>(line.strip_prefix("@nix ").unwrap_or(&line)) 152 152 .map(NixLog::Internal) 153 - .unwrap_or(if hint_error { 154 - NixLog::RawError(line) 155 - } else { 156 - NixLog::Raw(line) 157 - }); 153 + .unwrap_or(NixLog::Raw(line)); 158 154 159 155 // Throw out stop logs 160 156 if let NixLog::Internal(Internal { ··· 166 162 167 163 log 168 164 } 169 - Self::Raw if hint_error => NixLog::RawError(line), 170 165 Self::Raw => NixLog::Raw(line), 171 166 }; 172 167
+1 -1
wire/lib/src/commands/noninteractive.rs
··· 187 187 let mut io_reader = tokio::io::AsyncBufReadExt::lines(BufReader::new(reader)); 188 188 189 189 while let Some(line) = io_reader.next_line().await.unwrap() { 190 - let log = output_mode.trace(line.clone(), is_error); 190 + let log = output_mode.trace(line.clone()); 191 191 192 192 if !is_error { 193 193 let mut queue = collection.lock().await;
+2 -4
wire/lib/src/nix_log.rs
··· 4 4 use serde::{Deserialize, Serialize}; 5 5 use serde_repr::{Deserialize_repr, Serialize_repr}; 6 6 use std::fmt::{Debug, Display}; 7 - use tracing::{Level as tracing_level, error, event, info}; 7 + use tracing::{Level as tracing_level, event, info}; 8 8 9 9 // static DIGEST_RE: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"[0-9a-z]{32}").unwrap()); 10 10 ··· 44 44 pub enum NixLog { 45 45 Internal(Internal), 46 46 Raw(String), 47 - RawError(String), 48 47 } 49 48 50 49 pub(crate) trait Trace { ··· 102 101 // ); 103 102 } 104 103 NixLog::Raw(line) => info!("{line}"), 105 - NixLog::RawError(line) => error!("{line}"), 106 104 } 107 105 } 108 106 } ··· 129 127 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 130 128 match &self { 131 129 NixLog::Internal(line) => Display::fmt(&line, f), 132 - NixLog::Raw(line) | NixLog::RawError(line) => Display::fmt(&line, f), 130 + NixLog::Raw(line) => Display::fmt(&line, f), 133 131 } 134 132 } 135 133 }