opt: more debug info

This commit is contained in:
Kingtous
2023-02-07 19:33:58 +08:00
parent db8b6d618f
commit c4b1c51e9e
3 changed files with 7 additions and 6 deletions

View File

@@ -549,9 +549,11 @@ pub mod connection_manager {
let mut h: HashMap<&str, &str> = event.iter().cloned().collect();
assert!(h.get("name").is_none());
h.insert("name", name);
if let Some(s) = GLOBAL_EVENT_STREAM.read().unwrap().get(super::APP_TYPE_CM) {
s.add(serde_json::ser::to_string(&h).unwrap_or("".to_owned()));
} else {
println!("Push event {} failed. No {} event stream found.", name, super::APP_TYPE_CM);
};
}
}