1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! Logs command arguments
use clap::Args;
/// View logs from nodes, framework, and services
#[derive(Args, Debug)]
pub struct LogsArgs {
/// Optional node name to filter logs (e.g., "camera_driver")
#[arg(value_name = "NODE")]
pub node: Option<String>,
/// Follow logs in real-time (default behavior, use --no-follow to disable)
#[arg(short, long, default_value = "true", action = clap::ArgAction::SetTrue)]
pub follow: bool,
/// Disable follow mode (show static logs)
#[arg(long, conflicts_with = "follow")]
pub no_follow: bool,
/// Filter logs by pattern (case-insensitive substring match)
#[arg(short = 'g', long, value_name = "PATTERN")]
pub filter: Option<String>,
/// Number of lines to show (tail behavior)
#[arg(short = 'n', long, value_name = "LINES", default_value = "100")]
pub lines: Option<usize>,
/// Log source type to display
#[arg(short = 's', long, value_name = "SOURCE", value_enum)]
pub source: Option<LogSource>,
/// Show timestamps
#[arg(short = 't', long)]
pub timestamps: bool,
/// Log level filter (error, warn, info, debug, trace)
#[arg(long, value_name = "LEVEL")]
pub level: Option<String>,
}
/// Log source types
#[derive(Debug, Clone, Copy, PartialEq, Eq, clap::ValueEnum)]
pub enum LogSource {
/// All log sources
All,
/// Node logs only
Nodes,
/// Framework/CLI logs
Framework,
/// Infrastructure services (Redis, PostgreSQL, etc.)
Services,
}