mirror of
https://codeberg.org/icewind/tf-log-parser.git
synced 2026-11-30 04:40:47 +01:00
kills module
This commit is contained in:
parent
b03d328ab9
commit
c8664f9e47
13 changed files with 233 additions and 36 deletions
|
|
@ -79,7 +79,7 @@ fn main() -> Result<(), MainError> {
|
|||
};
|
||||
black_box(output);
|
||||
},
|
||||
|| eprintln!("Paniced on {}", path.display()),
|
||||
|| eprintln!("Panicked on {}", path.display()),
|
||||
);
|
||||
|
||||
parse_time.fetch_add(
|
||||
|
|
@ -98,8 +98,8 @@ fn main() -> Result<(), MainError> {
|
|||
println!(
|
||||
"Parsed {} in {:01}s, spend {:01}s reading files, in {:01}s of real time",
|
||||
count.load(Ordering::Relaxed),
|
||||
micros_as_sec(read_time),
|
||||
micros_as_sec(parse_time),
|
||||
micros_as_sec(read_time),
|
||||
micros_as_sec(total.as_micros() as usize)
|
||||
);
|
||||
|
||||
|
|
|
|||
17
examples/kills.rs
Normal file
17
examples/kills.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
use main_error::MainError;
|
||||
use std::env::args;
|
||||
use std::fs;
|
||||
use tf_log_parser::module::Kills;
|
||||
use tf_log_parser::parse_with_handler;
|
||||
|
||||
fn main() -> Result<(), MainError> {
|
||||
let path = args().nth(1).expect("No path provided");
|
||||
let content = fs::read_to_string(path)?;
|
||||
|
||||
let kills = parse_with_handler::<Kills>(&content)?.0;
|
||||
|
||||
for kill in kills {
|
||||
println!("{}", serde_json::to_string(&kill)?);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue