// use std::io::{self, BufRead}; // use atty::Stream; use sift::log_database::LogDatabase; use sift::log_parser::TextParser; fn main() { // if atty::is(Stream::Stdin) { // println!("no pipe"); // return; // } // let stdin = io::stdin(); // for line in stdin.lock().lines() { // let line = line.expect("Failed to read line from stdin"); // println!("{}", line); // } let mut log_database = LogDatabase::new(TextParser { separator: None }); log_database.ingest(String::from("hello world")).unwrap(); log_database.ingest(String::from("have a good hello")).unwrap(); log_database.ingest(String::from("goodbye world")).unwrap(); println!("hello {:?}", log_database.find_value_string("hello").collect::>()); println!("have {:?}", log_database.find_value_string("have").collect::>()); println!("world {:?}", log_database.find_value_string("world").collect::>()); println!("elliot {:?}", log_database.find_value_string("elliot").collect::>()); }