@@ -14,3 +14,4 @@ clap.workspace = true
|
||||
dotenv.workspace = true
|
||||
axum.workspace = true
|
||||
reqwest.workspace = true
|
||||
uuid.workspace = true
|
||||
|
@@ -113,9 +113,9 @@ async fn handle_command(cmd: Command) -> anyhow::Result<()> {
|
||||
} => {
|
||||
tracing::info!("monitoring server: {}", server);
|
||||
|
||||
let mut cursor: Option<String> = None;
|
||||
let mut cursor: Option<uuid::Uuid> = None;
|
||||
loop {
|
||||
tracing::info!("reading logs from server: {}", server);
|
||||
tracing::debug!("reading logs from server: {}", server);
|
||||
|
||||
let resp = reqwest::get(format!(
|
||||
"{server}/logs{}",
|
||||
@@ -136,9 +136,9 @@ async fn handle_command(cmd: Command) -> anyhow::Result<()> {
|
||||
match resp.json::<ServerMonitorResp>().await {
|
||||
Ok(resp) => {
|
||||
for line in resp.logs {
|
||||
tracing::info!("server: {}", line);
|
||||
tracing::info!("event: {}", line);
|
||||
}
|
||||
cursor = Some(resp.cursor);
|
||||
cursor = resp.cursor;
|
||||
}
|
||||
Err(e) => {
|
||||
tracing::warn!("failed to call server (error={})", e);
|
||||
|
Reference in New Issue
Block a user