Feature/filter record by eventid#94 (#95)

* add function to get event id from rootnode.

* refactoring #76

* maybe fix bug.

* before test

* fix source files.

* cargo fmt --all

* add threadnum parameter
This commit is contained in:
James
2021-05-06 20:58:43 +09:00
committed by GitHub
parent a68a59417d
commit 2f24dc775f
4 changed files with 280 additions and 156 deletions
+5
View File
@@ -50,6 +50,7 @@ fn build_app<'a>() -> ArgMatches<'a> {
.arg(Arg::from_usage("-u --utc 'output time in UTC format(default: local time)'"))
.arg(Arg::from_usage("-d --directory=[DIRECTORY] 'event log files directory'"))
.arg(Arg::from_usage("-s --statistics 'event statistics'"))
.arg(Arg::from_usage("-t --threadnum=[NUM] 'thread number'"))
.arg(Arg::from_usage("--credits 'Zachary Mathis, Akira Nishikawa'"))
.get_matches()
}
@@ -79,6 +80,10 @@ impl EventKeyAliasConfig {
pub fn get_event_key(&self, alias: String) -> Option<&String> {
return self.key_to_eventkey.get(&alias);
}
pub fn get_event_key_values(&self) -> Vec<(&String, &String)> {
return self.key_to_eventkey.iter().map(|e| e).collect();
}
}
fn load_eventkey_alias(path: &str) -> EventKeyAliasConfig {