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.

[autofix.ci] apply automated fixes

authored by

autofix-ci[bot] and committed by
GitHub
b85ca6ad 9cdcc1b7

+16 -14
+6 -5
wire/lib/src/commands/mod.rs
··· 149 149 fn trace(self, line: &String) -> Option<nix_log::SubcommandLog<'_>> { 150 150 let log = match self { 151 151 ChildOutputMode::Nix => { 152 - let log = 153 - serde_json::from_str::<LogMessage>(line.strip_prefix(AT_NIX_PREFIX).unwrap_or(line)) 154 - .map(SubcommandLog::Internal) 155 - .unwrap_or(SubcommandLog::Raw(line.into())); 152 + let log = serde_json::from_str::<LogMessage>( 153 + line.strip_prefix(AT_NIX_PREFIX).unwrap_or(line), 154 + ) 155 + .map(SubcommandLog::Internal) 156 + .unwrap_or(SubcommandLog::Raw(line.into())); 156 157 157 - if !matches!(log, SubcommandLog::Internal(LogMessage::Msg {..})) { 158 + if !matches!(log, SubcommandLog::Internal(LogMessage::Msg { .. })) { 158 159 return None; 159 160 } 160 161
+10 -9
wire/lib/src/nix_log.rs
··· 1 1 // SPDX-License-Identifier: AGPL-3.0-or-later 2 2 // Copyright 2024-2025 wire Contributors 3 3 4 - use std::{borrow::Cow, fmt::{Debug, Display}}; 4 + use nix_compat::log::{LogMessage, VerbosityLevel}; 5 + use std::{ 6 + borrow::Cow, 7 + fmt::{Debug, Display}, 8 + }; 5 9 use tracing::{Level as tracing_level, event, info}; 6 - use nix_compat::log::{LogMessage, VerbosityLevel}; 7 10 8 11 // static DIGEST_RE: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"[0-9a-z]{32}").unwrap()); 9 12 ··· 38 41 39 42 match level { 40 43 VerbosityLevel::Info => event!(tracing_level::INFO, "{msg}"), 41 - VerbosityLevel::Warn | VerbosityLevel::Notice => event!(tracing_level::WARN, "{msg}"), 44 + VerbosityLevel::Warn | VerbosityLevel::Notice => { 45 + event!(tracing_level::WARN, "{msg}") 46 + } 42 47 VerbosityLevel::Error => event!(tracing_level::ERROR, "{msg}"), 43 48 VerbosityLevel::Debug => event!(tracing_level::DEBUG, "{msg}"), 44 49 VerbosityLevel::Vomit | VerbosityLevel::Talkative | VerbosityLevel::Chatty => { ··· 69 74 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 70 75 match &self { 71 76 SubcommandLog::Internal(line) => match line { 72 - LogMessage::Msg { level, msg } => 73 - write!( 74 - f, 75 - "{level:?}: {msg}" 76 - ), 77 - _ => Ok(()) 77 + LogMessage::Msg { level, msg } => write!(f, "{level:?}: {msg}"), 78 + _ => Ok(()), 78 79 }, 79 80 SubcommandLog::Raw(line) => Display::fmt(&line, f), 80 81 }