Browse Source

Add log entry

master
Schneider 4 years ago
parent
commit
4786f1e0f5
  1. 1
      .gitignore
  2. 3
      src/app.rs
  3. 6
      src/gitignore.rs

1
.gitignore

@ -1,3 +1,4 @@
/callgrind.out.justfile
/dist
/target
tags

3
src/app.rs

@ -8,7 +8,7 @@ use std::path::PathBuf;
use directories::ProjectDirs;
use structopt::StructOpt;
use log::{info, trace};
use log::{debug, info, trace};
// Local Imports
use crate::cache::File as FileCache;
@ -88,6 +88,7 @@ fn run_add(glob: &str) -> Result<()> {
file_path.push(".gitignore");
let gitig = Gitignore::from_path(&file_path);
gitig.add_line(glob)?;
debug!("Added '{}' to {}", glob, gitig);
Ok(())
}

6
src/gitignore.rs

@ -27,3 +27,9 @@ impl Gitignore {
Ok(())
}
}
impl std::fmt::Display for Gitignore {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
write!(f, "gitignore file {}", self.path.to_string_lossy())
}
}
Loading…
Cancel
Save