logger: add cgroup option
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user