mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
add endpoint for dmesg logs
This commit is contained in:
committed by
Aiden McClelland
parent
39a2685506
commit
659af734eb
@@ -8,7 +8,7 @@ use tokio::sync::RwLock;
|
||||
use tracing::instrument;
|
||||
|
||||
use crate::context::RpcContext;
|
||||
use crate::disk::util::{get_available, get_percentage, get_used};
|
||||
use crate::disk::util::{get_available, get_used};
|
||||
use crate::logs::{display_logs, fetch_logs, LogResponse, LogSource};
|
||||
use crate::shutdown::Shutdown;
|
||||
use crate::util::serde::{display_serializable, IoFormat};
|
||||
@@ -31,6 +31,21 @@ pub async fn logs(
|
||||
.await?)
|
||||
}
|
||||
|
||||
#[command(rename = "kernel-logs", display(display_logs))]
|
||||
pub async fn kernel_logs(
|
||||
#[arg] limit: Option<usize>,
|
||||
#[arg] cursor: Option<String>,
|
||||
#[arg] before_flag: Option<bool>,
|
||||
) -> Result<LogResponse, Error> {
|
||||
Ok(fetch_logs(
|
||||
LogSource::Kernel,
|
||||
limit,
|
||||
cursor,
|
||||
before_flag.unwrap_or(false),
|
||||
)
|
||||
.await?)
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct MetricLeaf<T> {
|
||||
value: T,
|
||||
|
||||
Reference in New Issue
Block a user