add tracing

This commit is contained in:
Qyriad 2026-02-02 17:43:44 +01:00
parent 9ae0630db4
commit a06790a2af
7 changed files with 413 additions and 17 deletions

View file

@ -27,6 +27,8 @@ pub(crate) mod prelude {
pub use fs_err::os::unix::fs::{FileExt, OpenOptionsExt};
pub use tap::{Pipe, Tap};
pub use tracing::{Level, debug, error, info, trace, warn};
}
use prelude::*;
@ -34,7 +36,7 @@ use prelude::*;
pub mod args;
pub use args::{AppendCmd, Args};
mod color;
pub use color::{CLI_ENABLE_COLOR, SHOULD_COLOR};
pub use color::{_CLI_ENABLE_COLOR, SHOULD_COLOR};
pub mod line;
mod nixcmd;
pub use line::Line;
@ -47,6 +49,7 @@ use crate::source::SourceFile;
pub const ASCII_WHITESPACE: &[char] = &['\t', '\n', '\x0C', '\r', ' '];
#[tracing::instrument(level = "debug")]
pub fn do_append(args: Arc<Args>, append_args: AppendCmd) -> Result<(), BoxDynError> {
let filepath = Path::new(&args.file);
let filepath: PathBuf = if filepath.is_relative() && !filepath.starts_with("./") {