1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-06-03 17:14:08 +02:00

add follow option to log command

This commit is contained in:
Robin Appelman 2022-02-18 16:30:49 +01:00
commit 1f438e8e4f
3 changed files with 37 additions and 14 deletions

View file

@ -8,6 +8,7 @@ use crate::service::Service;
use crate::service::ServiceTrait;
use bollard::Docker;
use miette::{IntoDiagnostic, Result, WrapErr};
use std::io::stdout;
mod args;
mod cloud;
@ -154,6 +155,7 @@ async fn main() -> Result<()> {
}
HazeArgs::Logs {
filter,
follow,
count,
service,
} => {
@ -163,10 +165,7 @@ async fn main() -> Result<()> {
} else {
cloud.id
};
let logs = container_logs(&docker, &container, count.unwrap_or(20)).await?;
for log in logs {
print!("{}", log);
}
container_logs(&docker, stdout(), &container, count.unwrap_or(20), follow).await?;
}
HazeArgs::Exec {
filter,