runtime-rs: Log system enhancement

By modifying RuntimeLevelFilter drain to improve logging control,
enabling isolation of change effect of the loggers between components,
tuning clh logs to be logged according to their log levels
given by cloud-hypervisor.

Fixes: #8310

Signed-off-by: Ruoqing He <linuxwatcher@outlook.com>
This commit is contained in:
Ruoqing He
2023-10-25 08:16:53 +00:00
parent 2a17d3889e
commit 4ad2cfe0c2
17 changed files with 312 additions and 32 deletions

View File

@@ -48,6 +48,9 @@ impl ResourceManager {
hypervisor: Arc<dyn Hypervisor>,
toml_config: Arc<TomlConfig>,
) -> Result<Self> {
// Regist resource logger for later use.
logging::register_subsystem_logger("runtimes", "resource");
Ok(Self {
inner: Arc::new(RwLock::new(
ResourceManagerInner::new(sid, agent, hypervisor, toml_config).await?,

View File

@@ -12,6 +12,7 @@ use async_trait::async_trait;
use kata_types::mount::Mount;
mod block_rootfs;
use hypervisor::{device::device_manager::DeviceManager, Hypervisor};
use std::{sync::Arc, vec::Vec};
use tokio::sync::RwLock;