krata: reimplement console to utilize channels, and provide logs support

This commit is contained in:
Alex Zenla
2024-04-02 08:57:34 +00:00
parent 0fd6318c5f
commit 5ad2e40a7b
17 changed files with 309 additions and 31 deletions

View File

@ -3,7 +3,7 @@ use std::path::Path;
use super::protocol::IdmPacket;
use anyhow::{anyhow, Result};
use bytes::BytesMut;
use log::error;
use log::{debug, error};
use nix::sys::termios::{cfmakeraw, tcgetattr, tcsetattr, SetArg};
use prost::Message;
use tokio::{
@ -41,7 +41,7 @@ impl IdmClient {
let (tx_sender, tx_receiver) = channel(IDM_PACKET_QUEUE_LEN);
let task = tokio::task::spawn(async move {
if let Err(error) = IdmClient::process(file, rx_sender, tx_receiver).await {
error!("failed to handle idm client processing: {}", error);
debug!("failed to handle idm client processing: {}", error);
}
});
Ok(IdmClient {