logs to client_api

This commit is contained in:
John Smith
2021-12-10 22:04:38 -05:00
parent 7e8eb0c57d
commit 43fd315932
6 changed files with 48 additions and 37 deletions

View File

@@ -43,6 +43,16 @@ impl veilid_client::Server for VeilidClientImpl {
Promise::ok(())
}
fn log_message(
&mut self,
params: veilid_client::LogMessageParams,
_results: veilid_client::LogMessageResults,
) -> Promise<(), ::capnp::Error> {
let message = pry!(pry!(params.get()).get_message());
self.comproc.add_log_message(message);
Promise::ok(())
}
}
struct ClientApiConnectionInner {

View File

@@ -277,6 +277,10 @@ debug - send a debugging command to the Veilid server
self.inner_mut().ui.set_attachment_state(state);
}
pub fn add_log_message(&mut self, message: &str) {
self.inner().ui.add_node_event(message);
}
// called by client_api_connection
// calls into ui
////////////////////////////////////////////