Skip to content

Commit

Permalink
Improve logging with parsed file name
Browse files Browse the repository at this point in the history
  • Loading branch information
ybyygu committed Mar 10, 2024
1 parent ce014dd commit eecb418
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/vasp/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ use std::fs::File;
use std::io::BufReader;

pub struct Outcar {
path: PathBuf,
reader: TextReader<BufReader<File>>,
}

impl Outcar {
pub fn try_from_path(f: &Path) -> Result<Self> {
let reader = TextReader::try_from_path(f)?;
Ok(Self { reader })
let path = f.to_owned();
Ok(Self { reader, path })
}
}
// 6f1bf8e7 ends here
Expand Down Expand Up @@ -423,7 +425,7 @@ impl Outcar {
.parse(&frame_text)
.map_err(|e| parse_error(e, &frame_text))?;
let pos = self.reader.get_current_position()?;
info!("Parsed one frame at position {pos}");
info!("Parsed one frame at position {pos} for file {:?}", self.path);
frame.symbols = symbols.clone();
frames.push(frame);
}
Expand Down

0 comments on commit eecb418

Please sign in to comment.