fixed error

- changed writer from stderr to bufwriter

- changed alert,warn function arg fro String to borrow-String
This commit is contained in:
DustInDark
2021-12-21 14:44:26 +09:00
parent f1c9418ab4
commit bccdd8fef9
7 changed files with 184 additions and 119 deletions

View File

@@ -1,8 +1,10 @@
extern crate csv;
use crate::detections::configs;
use crate::detections::print::AlertMessage;
use crate::detections::print::ERROR_LOG_PATH;
use crate::detections::print::MESSAGES;
use crate::detections::print::QUIET_ERRORS_FLAG;
use crate::detections::rule;
use crate::detections::rule::AggResult;
use crate::detections::rule::RuleNode;
@@ -88,10 +90,10 @@ impl Detection {
err_msgs_result.err().iter().for_each(|err_msgs| {
let errmsg_body =
format!("Failed to parse rule file. (FilePath : {})", rule.rulepath);
AlertMessage::warn(&mut std::io::stdout().lock(), errmsg_body).ok();
AlertMessage::warn(&mut std::io::stdout().lock(), &errmsg_body).ok();
err_msgs.iter().for_each(|err_msg| {
AlertMessage::warn(&mut std::io::stdout().lock(), err_msg.to_string()).ok();
AlertMessage::warn(&mut std::io::stdout().lock(), &err_msg.to_string()).ok();
});
parseerror_count += 1;
println!(""); // 一行開けるためのprintln