logger: add cgroup option

This commit is contained in:
Mikaël Cluseau
2026-04-13 21:11:07 +02:00
parent 33fcfbd197
commit dc936f52ab
8 changed files with 123 additions and 26 deletions

View File

@@ -1,5 +1,5 @@
use clap::{CommandFactory, Parser, Subcommand};
use eyre::{format_err, Result};
use eyre::{Result, format_err};
use human_units::Duration;
use log::{debug, error};
use std::net::SocketAddr;
@@ -39,6 +39,9 @@ enum Command {
/// prefix log lines with time & stream
#[arg(long)]
with_prefix: bool,
/// exec command in this cgroup
#[arg(long)]
cgroup: Option<String>,
command: String,
args: Vec<String>,
},
@@ -125,6 +128,7 @@ async fn main() -> Result<()> {
ref log_path,
ref log_name,
with_prefix,
cgroup,
command,
args,
} => {
@@ -136,7 +140,7 @@ async fn main() -> Result<()> {
log_name,
with_prefix,
}
.run(command, &args)
.run(cgroup, command, &args)
.await
}
C::Log {