changed rule read warn output from std to errorlog write #301
This commit is contained in:
14
src/yaml.rs
14
src/yaml.rs
@@ -72,7 +72,12 @@ impl ParseYaml {
|
||||
let read_content = self.read_file(path);
|
||||
if read_content.is_err() {
|
||||
AlertMessage::warn(
|
||||
&mut std::io::stdout().lock(),
|
||||
&mut BufWriter::new(
|
||||
OpenOptions::new()
|
||||
.append(true)
|
||||
.open(ERROR_LOG_PATH.to_string())
|
||||
.unwrap(),
|
||||
),
|
||||
format!(
|
||||
"fail to read file: {}\n{} ",
|
||||
entry.path().display(),
|
||||
@@ -87,7 +92,12 @@ impl ParseYaml {
|
||||
let yaml_contents = YamlLoader::load_from_str(&read_content.unwrap());
|
||||
if yaml_contents.is_err() {
|
||||
AlertMessage::warn(
|
||||
&mut std::io::stdout().lock(),
|
||||
&mut BufWriter::new(
|
||||
OpenOptions::new()
|
||||
.append(true)
|
||||
.open(ERROR_LOG_PATH.to_string())
|
||||
.unwrap(),
|
||||
),
|
||||
format!(
|
||||
"Failed to parse yml: {}\n{} ",
|
||||
entry.path().display(),
|
||||
|
||||
Reference in New Issue
Block a user