event_monitor: Append double newlines after each event

This allows to consume and parse the output event output file.

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen 2022-05-16 11:52:25 -07:00 committed by Sebastien Boeuf
parent 33e2a7121e
commit 32353fa389
2 changed files with 11 additions and 17 deletions

View file

@ -9,6 +9,7 @@ extern crate serde_derive;
use std::borrow::Cow;
use std::collections::HashMap;
use std::fs::File;
use std::io::Write;
use std::os::unix::io::AsRawFd;
use std::time::{Duration, Instant};
@ -50,6 +51,9 @@ pub fn event_log(source: &str, event: &str, properties: Option<&HashMap<Cow<str>
properties,
};
serde_json::to_writer_pretty(file, &e).ok();
let mut file = file;
file.write_all(b"\n\n").ok();
}
}